Skip to content

AAK-AGENT-TRUST-001: Coding agent run non-interactively (-p / headless) in CI trusts repo-resident config

Severity
HIGH
Category
Hook Injection (hook-injection)
Scanner
agent_audit_kit/scanners/agent_trust_surface.py
Auto-fixable
No.
SARIF name
HeadlessAgentInCiTrustsRepoConfig

What it detects

A CI workflow runs a coding-agent CLI in non-interactive mode (claude -p / --dangerously-skip-permissions, gemini --yolo, aider --yes, codex --full-auto, cursor-agent, opencode run, or a first-party agent Action). Non-interactive mode removes the workspace-trust prompt, so every repo-resident skill, command, MCP config, and task file is trusted on load and its instructions are honoured automatically. A study of malicious skill files (arXiv:2608.05223) measured coding agents executing the shell commands hidden in benign-appearing skill files in the large majority of runs (Gemini CLI 95.5-96.1%, Qwen Code 71.6-74.0%), with explicit safety recognition in only 1.99% of 5,629 runs. The trust prompt this path skips is the guardrail the per-file scanners (AAK-IDE-TASK-*, AAK-SKILL-*, AAK-AGENT-*) assume is present.

How to fix

Do not run a coding agent headless over the whole repo tree on every event. Restrict the agent to trusted refs, pin or allow-list the skill / MCP / task files it may load, and review new agent-config files in PRs before a workflow will execute them.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-AGENT-TRUST-001

Limitations

Single-artifact pre-screen, not a boundary control. These rules inspect one file at a time, so they cannot see intent split across several individually-benign skills loaded into the same agent context. Cross-skill composition defeats per-skill scanners: ColluSkill (arXiv:2608.09732) reports a 96.0% average attack success rate across six skill scanners, and SkillsMetric (arXiv:2608.08468) reports 0% detection for host-destruction via common shell commands and 42% for natural-language prompt injection. Run these early and cheaply as a first pass; they are not a guarantee. The composition blind spot they cannot see is covered by the set-level rule AAK-AGENT-COMPOSE-001.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-AGENT-TRUST-001.md: the page then shows that text, with the registry reference appended under it.