Skip to content

AAK-A2A-005: JWT token lifetime exceeds 1 hour

Severity
HIGH
Category
A2A Protocol (a2a-protocol)
Scanner
agent_audit_kit/scanners/a2a_protocol.py
Auto-fixable
No.
SARIF name
JwtTokenLifetimeTooLong

What it detects

An A2A Agent Card configures a JWT token lifetime greater than 1 hour (3600 seconds). Long-lived tokens increase the window for token theft and replay attacks.

How to fix

Set JWT token lifetime to 1 hour (3600 seconds) or less. Use refresh tokens for longer sessions.

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

agent-audit-kit scan . --rules AAK-A2A-005

Limitations

Reads tokenLifetime, token_lifetime, expiresIn and expires_in anywhere in the card, as a number of seconds or an Nh string. A lifetime written in days or minutes ("7d", "120m"), as an ISO 8601 duration (PT24H), or under another key (ttl, accessTokenLifetimeSeconds) is not read.

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