Skip to content

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

Layers between an upstream changelog and a branch in your repository
LayerWhat it enforcesPolicy key or proof
Zero-tool changelog extractionRelease-note prose becomes structured claims in a step with no tools.Scenario a10
AST cross-validationClaims the compiler AST does not corroborate stay UNVERIFIED_PROSE and never reach the migration worker.Scenarios a09 and a10
Migration sandboxZero network and zero secrets; the worker can only emit a unified diff.allowAgenticCodeMigrations
Policy Patch VerifierRejects diffs touching forbidden paths, adding unlisted dependencies or new shell or network primitives.forbiddenPaths, forbidUnlistedDependencies, forbidNewShellOrNetworkPrimitives
Merge capLLM-written changes stop at a verified pull request that a person merges.agenticMigrationMaxAutonomy: VERIFIED_PR
Validate the patch verifier settings in your policy
osty policy validate .osty/policy.yaml

Where 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.

Patch verifier section of .osty/policy.yamlyaml
patchVerifier:
  allowAgenticCodeMigrations: true
  agenticMigrationMaxAutonomy: VERIFIED_PR
  forbiddenPaths:
    - ".github/workflows/**"
    - ".circleci/**"
    - "**/auth/**"
  forbidUnlistedDependencies: true
  forbidNewShellOrNetworkPrimitives: true

The 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.

See what is actually exposed in 10 minutes

Connect a read-only GitHub App and cloud role. Osty installs nothing in your environment and writes nothing to your repositories. The report strips out backport and reachability noise before your team or coding agents patch it, and flags stale deploys and unowned workloads.