# How do you defend automated CVE patch PRs against changelog prompt injection?

Answers / AI patch safety. Breadcrumb: [Home](https://osty.dev/) / [Answers](https://osty.dev/answers) / 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.

Table: Layers between an upstream changelog and a branch in your repository

| 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` |

Validate the patch verifier settings in your policy:

```bash
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.yaml`:

```yaml
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.

## Related pages

- [Ship](https://osty.dev/ship): Policy-gated fleet campaigns on Temporal, zero-network migration cages capped at `VERIFIED_PR`, deterministic Policy Patch Verifier, canary gates and a stateful-safe kill switch.
- [Policy and Ledger](https://osty.dev/policy-ledger): Git-pinned, non-executable `.osty/policy.yaml` enforced by `osty-edge` on every mutating command, tighten-only overlays, release gates and the hash-chained Ed25519 Evidence Ledger.
- [Osty vs coding agents](https://osty.dev/compare/osty-vs-coding-agents): Why DIY coding agent patch scripts need ground truth and a deterministic verifier at fleet scale.
- [Policy builder](https://osty.dev/tools/policy-builder): Generate and validate a `.osty/policy.yaml` with patch verifier rules.

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

Get a free X-Ray: https://osty.dev/xray

Written by Osty Engineering. Published 2026-11-29. Updated 2026-11-29.

Canonical: https://osty.dev/answers/stop-prompt-injection-automated-cve-patch-prs
