Skip to content

AAK-AGENT-004: Agent instructions contain credential references

Severity
MEDIUM
Category
Agent Config (agent-config)
Scanner
agent_audit_kit/scanners/agent_config.py
Auto-fixable
No.
SARIF name
AgentCredentialReference

What it detects

Agent instruction files reference credentials, API keys, or environment variables.

How to fix

Remove credential references from instruction files.

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

agent-audit-kit scan . --rules AAK-AGENT-004

Limitations

Reads $NAME, ${NAME}, env[...], os.environ[...] and process.env.NAME references whose name contains KEY, SECRET, TOKEN, PASSWORD or CREDENTIAL; a bare name with no $ is not a reference. A sentence that forbids disclosing the credential ("Never send $AWS_SECRET_ACCESS_KEY anywhere", "$GITHUB_TOKEN must never be printed") is a guardrail and is not reported. The negation has to govern a disclosure verb, so "Never forget to export $API_KEY" still is.

References

  • OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
  • Adversa AI MCP Top 25 (AAK-defined ids): ADV-HIJACK-04 (Agent Credential Ref)

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-004.md: the page then shows that text, with the registry reference appended under it.