AAK-AGENT-TRUST-004: Gemini context/instruction file carries an embedded shell payload
- Severity
- MEDIUM
- Category
- Agent Config (
agent-config) - Scanner
agent_audit_kit/scanners/agent_trust_surface.py- Auto-fixable
- No.
- SARIF name
GeminiInstructionShellPayload
What it detects
A Gemini context / instruction file (GEMINI.md or a file under .gemini/) contains an embedded shell payload: a fenced shell block or a pipe-to-shell one-liner. Gemini auto-loads these files as context on session start, and the malicious-skill-file study (arXiv:2608.05223) measured this surface exploited in 95.5-96.1% of runs. The AAK-AGENT-* instruction-file family covered CLAUDE.md / AGENTS.md / .cursorrules / .windsurfrules / copilot-instructions.md but not the Gemini surface; this closes that gap.
How to fix
Do not ship executable shell in an agent context file. Keep GEMINI.md to prose guidance, move any real scripts into a reviewed, path-pinned location, and treat instruction files from an untrusted ref as untrusted input.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-AGENT-TRUST-004
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 Agentic Top 10: ASI01 (Agent Goal Hijack), ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-INJECT-04 (Tool Param Shell Injection)
- CSA AI Controls Matrix (AICM): AIS-08, 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-004.md: the page then shows that text, with the registry reference appended under it.