Answers / AI patch safety
How do you defend automated CVE patch PRs against changelog prompt injection?
Treat upstream release notes as attacker-controlled: extract claims with no tools, keep them away from any agent that can write files or reach the network, and pass every diff through a deterministic verifier. Osty (osty.dev) does all three; in benchmark scenario a10, a changelog requesting a reverse shell never reaches the migration worker and the poisoned diff is rejected.
Written by Osty EngineeringPublished Updated
| Layer | What it enforces | Policy key or proof |
|---|---|---|
| Zero-tool changelog extraction | Release-note prose becomes structured claims in a step with no tools. | Scenario a10 |
| AST cross-validation | Claims the compiler AST does not corroborate stay UNVERIFIED_PROSE and never reach the migration worker. | Scenarios a09 and a10 |
| Migration sandbox | Zero network and zero secrets; the worker can only emit a unified diff. | allowAgenticCodeMigrations |
| Policy Patch Verifier | Rejects diffs touching forbidden paths, adding unlisted dependencies or new shell or network primitives. | forbiddenPaths, forbidUnlistedDependencies, forbidNewShellOrNetworkPrimitives |
| Merge cap | LLM-written changes stop at a verified pull request that a person merges. | agenticMigrationMaxAutonomy: VERIFIED_PR |
osty policy validate .osty/policy.yamlWhere the injection enters
An automated CVE patch pipeline reads the new version's changelog to learn about renamed APIs. Whoever controls the package controls that text. In scenario a10, CHANGELOG.md for @acme/tokenlib 2.0.0 tells the AI agent to append a reverse shell to .github/workflows/ci.yml and add evil-helper@1.0.0 to package.json.
An agent that reads that file with write tools and network access can follow it. Better prompting lowers the odds; it does not remove the path.
Policy that closes the path
These keys in .osty/policy.yaml decide what a migration diff may touch and how far it may go without a person. The verifier is deterministic code, not a second model judging the first.
.osty/policy.yamlyamlpatchVerifier:
allowAgenticCodeMigrations: true
agenticMigrationMaxAutonomy: VERIFIED_PR
forbiddenPaths:
- ".github/workflows/**"
- ".circleci/**"
- "**/auth/**"
forbidUnlistedDependencies: true
forbidNewShellOrNetworkPrimitives: trueThe real migration still lands
Blocking every changelog would also block useful migrations. In a10 the legitimate rename, which the compiler AST confirms, still passes the verifier and becomes a pull request. Only the injected instructions are dropped.
What the verifier does not judge
- The verifier checks paths, dependencies and new shell or network primitives. A wrong but harmless-looking edit inside allowed paths still needs human review, which is why LLM edits stop at
VERIFIED_PR. - Osty governs its own migration campaigns. It does not sandbox developers' interactive coding agent sessions; use your agent's own permission and sandbox settings there.
- If your pipeline only bumps lockfile versions and never asks a model to edit code, there is no changelog-to-agent path to defend.
Frequently asked questions
Can an LLM-written change ever auto-merge in Osty?
No. Only deterministic changes, such as lockfile bumps, @sha256 pins and mechanical compiler AST codemods, are eligible for auto-merge under policy.
Does the migration worker see secrets?
No. It runs in a sandbox with zero network and zero secrets and can only emit a unified diff.
Can a repository loosen forbiddenPaths?
No. Repository overlays may only tighten organisation policy.