AI-Assisted Secure Coding (Appendix C) · Compromise Containment & Automated Remediation
Rotate secrets after a suspicious run
Verify that any secret that touched a workflow run associated with a suspicious PR, a prompt-injection event, or an AI-agent anomaly, or that is found in an agent session record, is automatically rotated, and that downstream issuers (cloud IAM, package registries, signing-key custodians) are notified of the rotation.
OWASP AISVS v1.01, requirement AC.14.2
In plain English
Rotate automatically any secret that touched a workflow run connected to a suspicious PR, a prompt injection event or an agent anomaly, and any secret found in an agent session record. Tell the systems that issued the secret as well, such as cloud IAM, package registries and signing-key custodians, so they can invalidate the old one and look for misuse.
What good looks like
- Rotation is triggered automatically by the listed events.
- Every secret the run could read is rotated, whether or not misuse is proven.
- Downstream issuers are notified of the rotation.
- Rotations are logged and verified, and the old credential no longer works.
How teams usually do it
- A secrets manager with rotation that security alerts can trigger.
- A mapping from each workflow and environment to the secrets it can reach, so the list is known in advance.
- Short-lived OIDC-issued credentials wherever possible, which leaves little to rotate.
Suggested evidence
- Automation configuration.
- Rotation logs tied to a triggering event.
- A check that an old credential was refused.
Common mistakes
- Rotating the obvious secret and missing others the run could read.
- Issuing a new secret without revoking the old one.
- Forgetting package-registry publishing tokens and signing keys.
Not sure which requirements apply to your system? Take the assessment, or browse every guide in this chapter.
Requirement text from the OWASP AI Security Verification Standard, licensed under CC BY-SA 4.0. This guidance is shared under the same licence.