AI-Assisted Secure Coding (Appendix C) · Continuous Feedback, Adversarial Testing & Model Fine-Tuning
Regression-test every model change
Verify that a closed-loop evaluation harness runs regression tests after every fine-tune, system-prompt change, or model upgrade. Security metrics must meet or exceed the prior baseline before deployment.
OWASP AISVS v1.01, requirement AC.6.4
In plain English
After every fine-tune, system prompt change or model upgrade, rerun a security regression suite automatically. The new configuration should deploy only if its security results match or beat the previous one. This is a Level 3 control.
What good looks like
- A regression suite runs automatically on each of those changes.
- Results are compared with the stored baseline for the previous version.
- Worse security results block deployment.
- The suite grows from red-team findings and flagged suggestions.
How teams usually do it
- An evaluation job in the pipeline that manages the tool's configuration, using a harness such as promptfoo or Inspect.
- Test cases for insecure-code generation (for example prompts that tempt SQL injection or weak cryptography) and for injection resistance.
- Pinning the model version in tool settings, so that an upgrade is a change you make and test.
Suggested evidence
- Results per change, with the baseline comparison.
- A change that was held back by the suite.
Common mistakes
- Upgrading the model in the tool's settings with no testing.
- Vendor auto-updates that change the model without any trigger for your tests.
- A baseline that is overwritten by every run, so regressions accumulate unnoticed.
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.