{ Prompts4All }

Audit AI agents in CI for injection risk

Agent Audit

Audit each place where an AI agent runs automatically in the CI or the automation of this repository, for example a workflow that reviews pull requests, sorts issues, or repairs a failed build.

  1. Inventory. For each workflow give:

    • the events that start it;
    • who can cause those events: maintainers only, each contributor, or each person on the internet;
    • the tools that the agent gets;
    • the permissions of its token, and the secrets in its environment;
    • whether it runs on code from a fork.
  2. Untrusted text. List each text that gets into the prompt of the agent and that a person outside the team can write: issue titles and bodies, comments, pull request descriptions, commit messages, branch names, files in the pull request (also instruction files such as AGENTS.md in a fork), code comments, and test output.

  3. Powers. List what the agent can do in that job: write to the repository, push, comment, approve, merge, release, run shell commands, use the network, and read secrets.

  4. For each workflow describe the worst realistic attack: the text that an outsider writes, what the agent does then, and what is lost. Examine these cases:

    • an issue that tells the agent to print its environment in a comment;
    • a pull request with an instruction file that tells the agent to approve the pull request;
    • a title or a branch name that goes into a shell command with no quoting.
  5. Controls. For each workflow answer:

    • Is the trigger limited to trusted users?
    • Does the token have the smallest permissions that the job needs?
    • Are secrets absent from the jobs that read untrusted text?
    • Is the tool list of the agent limited in those jobs (no shell, no network)?
    • Is the output of the agent used as untrusted data (not executed, not merged automatically)?
    • Are third-party actions pinned to a commit hash?
    • Does a person approve before a write?

Rules:

  • This audit is read-only. Do not start a workflow.
  • Do not open test issues or pull requests in the real repository.
  • Give the file and the line for each finding.

Output: a table with one row for each workflow and these columns: who can start it, untrusted text, powers, worst case, severity, smallest fix. Then list the workflows that are safe, with the reason.