.agents/skills/create-repo-agent/references/security-standards.md
Use these standards for every Langfuse repo-owned autonomous agent. They are intentionally stricter than a normal CI workflow because an LLM step consumes untrusted instructions, web pages, source files, and prior outputs.
Official references:
${{ github.token }}.permissions to the minimum necessary. For read-only audit jobs, use contents: read.github_token: ${{ github.token }} explicitly to LLM actions that otherwise try to discover a token from the environment, and keep the job permission read-only.secrets.GH_ACCESS_TOKEN, write-scoped PATs, GitHub App private keys, SSH keys, cloud credentials, package-registry tokens, or OIDC tokens to the LLM step.id-token: write unless there is a reviewed OIDC trust boundary and the agent's objective cannot be met without it.Read, Edit, and Write tools for exact paths or path globs.WebFetch for official sources instead of shell network tools.Bash(command ...) entries only for deterministic, repo-owned validators or simple non-sensitive commands such as date -u +%Y-%m-%dT00:00:00.000Z.Bash(*), Bash(node:*), Bash(python:*), Bash(curl:*), Bash(wget:*), Bash(gh:*), Bash(git:*), Bash(pnpm:*), or Bash(npm:*).cat, sed, grep, rg, jq, env, printenv, ps, or ls unless the exact command is required and safe. File reads should go through scoped read tools.git push, PR creation, GitHub API calls, package installs, package publishing, dependency updates, or arbitrary interpreters in the LLM step.Every repo-agent prompt must state:
Do not rely on the prompt as the enforcement layer. The prompt guides the model; the workflow must still enforce file, command, token, and publish boundaries.
Independent diff validation must run after the agent and before publishing:
changed_files from both git diff --name-only and git ls-files --others --exclude-standard.git add -N -- "${untracked_files[@]}" before git diff --check and line-count checks when untracked files exist.git diff --check -- "${changed_files[@]}".git add -- "${changed_files[@]}".git diff --cached --name-only against the same allowlist.git diff --cached --check -- "${staged_files[@]}" before commit.Use a two-phase architecture for agents that create PRs:
persist-credentials: false, runs the LLM with read-only permissions, validates the diff, commits locally with hooks disabled, and uploads a git bundle plus PR body artifact.Self-improvement is allowed only when the workflow explicitly opts in.
id-token: write, package-manager tools, gh, git push, or broad file globs.