AAK-AGENT-TRUST-003: Repo-resident agent settings bake in trust / auto-approval
- Severity
- HIGH
- Category
- Agent Config (
agent-config) - Scanner
agent_audit_kit/scanners/agent_trust_surface.py- Auto-fixable
- No.
- SARIF name
AgentSettingsPersistTrust
What it detects
A checked-in agent settings file (.claude/settings.json, .gemini/settings.json, .cursor/settings.json, and siblings) sets a flag that persists trust or auto-approval: bypassPermissions, permissionMode: bypassPermissions, autoApprove, an approval mode of yolo / full-auto, or trust: true. Trust-on-first-use is then baked into the repository rather than granted per session, so it survives every subsequent invocation (including a headless CI run) and travels with the repository when it is forked or checked out on an untrusted ref.
How to fix
Remove the persisted-trust / auto-approve flag from the checked-in settings. Grant approval per session interactively, or scope it to an explicit, minimal allow-list of tools rather than a blanket bypass.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-AGENT-TRUST-003
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
- OWASP MCP Top 10: MCP02:2025 (Privilege Escalation via Scope Creep)
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation), ASI09 (Human-Agent Trust Exploitation)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-PRIV-01 (Hook Privilege Escalation)
- CSA AI Controls Matrix (AICM): IAM-05, STA-08
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-003.md: the page then shows that text, with the registry reference appended under it.