Skip to content

Require a TTY or CI=1 for --dangerously-run-scripts #408

Description

@thecodedrift

--dangerously-run-scripts runs a runtime rule's check.ts (arbitrary code) with no server verification. Today it is accepted in any context, so an agent that hits a withheld or unverified runtime rule can add the flag to get a green run and carry on. #406 tells the check and ci recipes not to do that, but a recipe is advice and the flag is the gate.

Proposal

Accept the flag only when a human is plausibly present or the caller has declared a CI context:

  • process.stdin.isTTY (or stdout) is true, or
  • CI=1 / CI=true is set.

Otherwise refuse with a coded error (e.g. UNSAFE_FLAG_REQUIRES_TTY) that says why, so an agent stops and asks the user instead of retrying. The refusal must happen before any check.ts is loaded.

Where the flag is accepted today

  • taskless check (commands/check.ts, plan via rules/runtime/plan.ts)
  • taskless test / verify (commands/verify.ts, rules/inspect.ts)
  • taskless demo (commands/demo.ts)

Recipes that must change with it

agent/create-runtime-rule.md tells an agent to run test .taskless/rules/runtime/<name> --dangerously-run-scripts as an ordinary authoring step (line ~104), and agent/verify-rule.md offers the flag as an alternative to a blessed signature. Under this gate an agent in a non-TTY shell without CI is refused at that step, which is the intent, so the recipe needs to say "ask the user to run this, or to confirm" instead.

Open question

Whether CI=1 should be enough on its own, or whether CI should also need an explicit opt-in (e.g. TASKLESS_ALLOW_UNVERIFIED_SCRIPTS=1), since an agent can set CI=1 as easily as it can pass the flag. CI=1 still forces a deliberate second step, which is the main goal.

Refs #403

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions