# Pm AI Prompt Injection To Defense

> Turn a suspected or observed prompt injection, indirect injection, tool poisoning, or untrusted agent/MCP content path into an evidence-bounded attack-path and defense contract with trust boundaries, authority separation, least-privilege controls, negative evals, rollback, and a Ship, Pilot, Hold, Block, or Need evidence decision. Use when a PM reviews agent, RAG, MCP, retrieval, tool, browser, delegated-agent, memory, or external-content behavior that may influence an AI decision or side effect; do not treat a model refusal, scanner result, or completed checklist as proof of product security.

- Skill: `asdc163/pm-ai-prompt-injection-to-defense` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add asdc163/pm-ai-prompt-injection-to-defense`
- Raw SKILL.md: https://api.skillmd.com/api/skills/asdc163/pm-ai-prompt-injection-to-defense/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: asdc163 (https://skillmd.com/u/asdc163)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/asdc163/pm-ai-prompt-injection-to-defense

---


# PM AI Prompt Injection to Defense

Turn one concrete path of untrusted content into a reviewable product decision.
The useful unit is not an attack prompt. It is the chain from source to
authority to action:

`untrusted source → context or metadata sink → agent decision → tool/data effect → possible harm`

Use the output to decide what must be separated, constrained, reviewed,
tested, monitored, or held. Keep model behavior, product controls, and live
security evidence separate.

This is a planning and evaluation aid. It does not scan a system, execute an
exploit, install an MCP server, sanitize arbitrary text, certify a product, or
prove that a model or agent is secure.

## When to use

Use this skill when the input includes one or more of these:

- a retrieved page, PDF, email, issue, PR, document, memory item, or user
  message may contain instructions that should remain data;
- an MCP or agent tool description, schema, README, example, or result may
  change what the model calls or what data it exposes;
- a delegated agent, handoff, browser step, or tool chain may carry authority
  across a trust boundary;
- a red-team observation, user report, trace, or proposed feature needs an
  attack path, defense choice, negative eval, or release decision;
- a PM needs to distinguish model refusal from a product control that prevents
  a dangerous call, write, network request, or data disclosure.

Use `pm-ai-risk-to-control` for a broad pre-launch hazard register. Use
`pm-ai-tool-to-contract` when the primary job is to define a tool's purpose,
schema, permissions, and side effects. Use `pm-ai-context-to-contract` when
the primary job is context assembly, source freshness, memory, or compaction.
Use `pm-ai-trace-to-regression` when a concrete failed trace is already known
and the main job is to create one minimal regression case. Use
`pm-ai-approval-to-flow` when the open decision is the user-facing approval
flow for an already-defined action.

Do not use this skill to run a live attack, paste private payloads, call a
provider, install a scanner or MCP server, change a permission, disable a
production tool, or claim security coverage from a completed table.

## Guardrails

1. Start with one user job, one protected asset or side effect, one source
   path, one authority boundary, one owner, and one decision deadline.
2. Treat user text, retrieved content, tool metadata, tool output, memory,
   network response, issue, PR, webpage, and delegated-agent output as data
   until an explicit product rule grants authority.
3. Separate `source influence` from `policy authority`. Content can affect a
   model's next token without gaining permission to change policy or act.
4. Label every material statement `Observed`, `Reproduced`, `Proposed`, `Not
   run`, or `Unknown`. Do not invent attack success, prevalence, severity,
   likelihood, or control effectiveness.
5. Map the full path, including the tool or data effect. A model saying “no” is not enough: inspect whether a tool call, network request, write, or disclosure already happened. A model refusal is not proof of product containment.
6. Prefer the smallest boundary that protects the job: source quarantine,
   data/instruction separation, allowlist, schema check, scope reduction,
   human approval, sandbox, egress control, safe abort, or manual fallback.
7. Test benign lookalikes and negative routes. A defense that blocks every
   document containing imperative language can break the user's actual job.
8. A proposed defense is not a passed control. Attach an oracle, slice, owner,
   run status, and re-test trigger for model, tool, source, policy, prompt,
   permission, or client changes.
9. Do not place raw prompts, customer text, secrets, tokens, cookies, private
   URLs, hidden instructions, or sensitive identifiers in a public artifact.
   Do not treat a model refusal as proof that the product contained the path.
10. If source provenance, authority, tool scope, owner, oracle, fallback, or
    rollback is missing, return `Need evidence`, `Hold`, or `Block`.

## Core definitions

| Term | Meaning | Do not confuse it with |
|---|---|---|
| `Untrusted source` | Content that may influence an AI step but has not earned policy authority | useless content |
| `Injection` | Content that attempts to redirect an agent away from the declared user job or policy | any imperative sentence |
| `Indirect injection` | Injection carried through a retrieved, remote, or tool-returned artifact rather than the user's direct request | a direct user request |
| `Tool poisoning` | Malicious or misleading instructions embedded in tool metadata, schema, examples, or results | a normal tool error |
| `Authority boundary` | The rule that decides which actor or source may authorize a decision or side effect | model attention or confidence |
| `Attack path` | The source-to-sink chain connecting content influence to an agent decision and possible effect | an isolated attack string |
| `Control` | A product, technical, human, or operational measure that limits, detects, or recovers from the path | a security promise |
| `Control oracle` | A deterministic, reference, human, or outcome check that can tell whether the control worked | a model refusal or scan count |
| `Negative route` | A case that must abstain, clarify, deny, quarantine, escalate, or recover | a failed happy path |
| `Release decision` | `Ship`, `Pilot`, `Hold`, `Block`, or `Need evidence` with conditions and owner | a security certification |

## Workflow

### 1. Frame the job and decision

Write one sentence:

> Decide whether `...` can proceed for `...` when `...` may influence `...`,
> and choose `Ship`, `Pilot`, `Hold`, `Block`, or `Need evidence`.

Record the current workaround, affected user, protected asset or side effect,
decision owner, observation window, version boundary, and what would change the
decision. Use `Not provided` instead of guessing.

### 2. Freeze the evidence and provenance

Create stable IDs such as `SRC-001`, `PATH-001`, `ASSET-001`, `CTRL-001`, and
`EVAL-001`. For every source or trace, record:

- source class: user, retrieved, webpage, PDF, issue/PR, tool metadata, tool
  result, memory, delegated agent, network, or unknown;
- pointer, version/date, owner, tenant or scope, and privacy classification;
- status: `Observed`, `Reproduced`, `Proposed`, `Not run`, or `Unknown`;
- what is missing, stale, synthetic, or only reported by a person.

Keep the raw content out of the public packet. Quote only a short sanitized
description of the behavior when the exact text is not needed.

### 3. Separate data, instruction, and authority

Make three rows for each material source:

| Layer | Question | Safe default |
|---|---|---|
| Data | What information may the agent read or summarize? | Treat as untrusted content |
| Instruction | What text may shape the model's next step? | Constrain, label, and preserve provenance |
| Authority | Who may change policy, scope, permission, or side effect? | Require an explicit product rule |

If the same artifact contains a legitimate user task and hostile instructions,
preserve the legitimate task as data while denying the artifact permission to
change policy or invoke a new tool.

### 4. Map and classify the attack path

Write:

`source → entry point → context/metadata sink → model or agent decision → tool,
network, data, or UI effect → affected user/asset → harm → detection/recovery gap`

Classify the path with one or more of these labels:

- `Direct injection`: the user message attempts to override the declared
  policy, job, or tool boundary;
- `Indirect injection`: a retrieved or remote artifact carries the override;
- `Tool metadata poisoning`: a description, schema, example, or registration
  suggests an unrelated, over-privileged, or secret-seeking action;
- `Tool response poisoning`: returned data contains instructions that try to
  become the next authority or trigger a new tool;
- `Delegation injection`: a handoff or nested agent passes untrusted authority
  across an agent boundary;
- `Memory or state poisoning`: a stored item changes future behavior without a
  valid write, scope, freshness, or correction rule;
- `Benign lookalike`: legitimate content resembles an injection and must remain
  available to the user job.

Do not collapse the labels into “the prompt was bad.” Name the effect that the
path could produce, such as an unrelated tool call, data disclosure, policy
override, cross-tenant read, irreversible write, or cost-exhausting loop.

### 5. Choose the smallest defense set

For each path, select only controls that address a named boundary:

| Boundary | Possible control | Oracle |
|---|---|---|
| Source | provenance, quarantine, source allowlist, freshness or tenant filter | source ID and eligibility check |
| Context | data/instruction separation, taint label, bounded selection, no authority inheritance | context manifest or assembly assertion |
| Tool metadata | version pin, description/schema review, capability diff, least-privilege tool list | reviewed metadata diff |
| Tool call | intent-to-tool check, schema validation, no-tool route, deterministic policy | expected call or deny oracle |
| Tool result | output validation, secret scan, result quarantine, no automatic chaining | safe-result assertion |
| Authority | explicit user consent, role/scope check, current approval, per-action receipt | authorization/approval record |
| Runtime | sandbox, egress allowlist, timeout, loop/cost budget, disable path | boundary or budget test |
| Recovery | safe abort, manual route, compensation, rollback, reopen rule | recovery state and owner |

Prefer a control that still protects the user when the model follows the
malicious content. Do not make “the model should ignore it” the only defense.

### 6. Build the adversarial evaluation matrix

Include at least:

1. one golden user job that must continue;
2. one direct injection case;
3. one indirect retrieved-content case;
4. one tool metadata or tool-result poisoning case when tools are in scope;
5. one no-tool or clarification case;
6. one secret, privacy, cross-tenant, or high-impact side-effect case when
   relevant;
7. one benign lookalike and one recovery case.

For every case, record the input class, expected agent/tool route, must-not-
occur effect, oracle, execution status, reviewer, evidence pointer, and what
gets added to the regression set if it fails.

Keep these claims separate:

- the model refused the content;
- the tool call was not made;
- the side effect was blocked;
- the data did not cross the boundary;
- the user got a safe recovery path.

### 7. Set the release, fallback, and rollback decision

Use the smallest proportionate decision:

- `Ship`: critical cases pass, no P1 privacy/security/tool-action blocker is
  open, owner and rollback are real, and the evidence scope is explicit;
- `Pilot`: scope is narrow, high-risk actions are gated, monitoring and human
  review exist, and unresolved cases have owners and deadlines;
- `Hold`: evidence, source, oracle, owner, or denominator is missing;
- `Block`: a must-not-occur action or disclosure is reproduced and not
  contained;
- `Need evidence`: the question is well framed but the relevant test or
  artifact has not run.

Name the user-visible effect, disable path, owner, TTL/review date, recovery
route, rollback trigger, and next learning question. `Restore` requires a new
verification window; it is not the absence of a new report.

### 8. Write back and ask one review question

Return a packet that a PM, engineering owner, security reviewer, and operations
owner can all inspect. Write the new regression or unresolved boundary to the
authorized evaluation or decision record. End with one concrete ask:
`Approve the pilot`, `Hold pending tool metadata review`, `Add this case to the
regression set`, or `Need the missing source/owner/oracle`.

## Output contract

Return these sections in order. Use `Not provided`, `Unknown`, `Not run`, `Not
verified`, `Proposed`, or `Not covered` when evidence is missing.

### Decision on the desk

State the user job, current workaround, protected asset or side effect,
decision owner, source/version boundary, and conditional release decision.

### Scenario and evidence ledger

List source IDs, source class, pointer, date/version, scope, privacy boundary,
status, limitation, and next validation. Do not include raw sensitive content.

### Trust and authority map

Show data, instruction, authority, user/agent identity, tool scope, tenant or
network boundary, approval point, and human stop/recovery point.

### Attack path and harm map

For each `PATH-...`, show classification, source, sink, decision, effect,
affected user/asset, possible harm, evidence status, and detection/recovery gap.

### Defense register

Use one row per path/control relationship:

| Path | Boundary | Control | Type | Owner | Oracle/status | Failure behavior | Decision |
|---|---|---|---|---|---|---|---|
| `PATH-001` | source/context/tool/authority | specific control | preventive/detective/corrective | role or `Not provided` | check + status | safe fallback | conditional state |

Do not reduce the register to a severity score. Proposed controls do not lower
residual risk until their oracle has passed.

### Adversarial evaluation matrix

List golden, direct, indirect, tool-poisoning, no-tool, privacy/high-impact,
benign-lookalike, and recovery cases as relevant. Include expected route,
must-not-occur effect, oracle, execution status, reviewer, and writeback.

### User-visible control and recovery

Describe what the user sees when content is quarantined, a tool is denied, an
approval is required, a result is unavailable, or a manual route takes over.
State whether the user can inspect, correct, retry, cancel, or resume.

### Release, fallback, and rollback

State must-pass conditions, must-not-occur effects, pilot scope, monitoring,
disable/kill owner, TTL, rollback trigger/action, restore verification, and the
next learning question.

### Not covered

List unrun attacks, unknown client/provider behavior, unverified deployment,
scanner coverage, live prevalence, likelihood/severity calibration, legal or
compliance review, secrets or tenant isolation, adoption, traffic, retention,
and star impact. State which gap blocks the decision.

### Review ask

Ask for one decision from the authorized owner and name the one missing
artifact, control, or regression case that must be resolved next.

## Common rationalizations and red flags

| Rationalization | Corrective response |
|---|---|
| “The model refused, so the product is safe.” | Check whether a tool call, write, disclosure, or network effect was prevented and recorded. |
| “It is only a document, so it cannot be an attack.” | Retrieved, remote, and tool-returned content can influence the next step; map the sink and authority boundary. |
| “The scanner found nothing.” | Record scanner version, cases, false negatives, scope, and unrun paths; a scan is not containment evidence. |
| “We can trust this tool because the name is familiar.” | Review origin, version, capability diff, metadata, scope, output handling, and approval. |
| “Block every imperative sentence.” | Add benign lookalikes and preserve the user's legitimate task. |
| “No incident has happened.” | Record `No observed incident supplied`; do not convert silence into low risk. |
| “The checklist is complete.” | Require an oracle, run status, owner, fallback, and rollback for each material control. |
| “We can test with the real customer payload.” | Replace it with a sanitized fixture and keep raw data behind its approved boundary. |

Red flags that require `Hold`, `Block`, or `Need evidence` include an unknown
source with write/execute/network scope, unreviewed tool metadata, automatic
chaining from tool results, missing approval for an irreversible action,
cross-tenant ambiguity, secret-shaped output, absent rollback, or a claimed
security result with no run status.

## Edge cases

- **Benign content looks hostile:** preserve the user job, label the phrase as
  data, add the control case, and measure false-positive risk.
- **The user explicitly asks to follow a retrieved instruction:** distinguish
  the user's authorized goal from the artifact's attempt to expand scope; the
  user request does not automatically grant a tool or data permission.
- **The tool call is read-only:** still check privacy, tenant scope, source
  authority, rate/cost budget, and whether the result can trigger a write.
- **The model follows the injection but no tool runs:** record model behavior,
  keep the product effect as contained only if the output boundary was actually
  safe, and add a regression case.
- **The tool rejects the call but reveals sensitive parameters:** treat the
  rejection as insufficient; inspect the pre-call boundary and logs.
- **A delegated agent receives the content:** keep the original source ID,
  authority scope, and handoff receipt; do not let delegation erase provenance.
- **Multiple sources conflict:** preserve each source and authority status;
  route to clarification or `Need evidence` rather than averaging them.
- **The provider offers a prompt-injection detector:** record its version,
  placement, behavior on tool calls/results, latency/cost, false positives,
  and fallback; do not treat the detector as the entire control.
- **A real security report arrives:** preserve a sanitized report, stop the
  release claim, assign an owner, reproduce only with authorization, and add a
  regression case before changing the public story.

## References and first run

Read the bundled [prompt-injection defense reference](references/prompt-injection-defense-contract.md)
for the field template and current official method links. Start with the
[fictional first run](examples/first-run.md); it is a fixture, not adoption or
security evidence.

## Final check

Before returning the packet, verify:

- the user job, asset/side effect, owner, source, version window, and decision
  deadline are explicit;
- data, instruction, and authority are not blended;
- the complete source-to-effect path, harm, scope, and recovery gap are named;
- direct, indirect, tool metadata, tool result, delegation, memory, and benign
  lookalike cases are handled or marked `Not covered`;
- every material defense has a type, owner, oracle, status, failure behavior,
  fallback, and rollback/re-test trigger;
- evaluation contains golden, negative, red-team, privacy/high-impact, and
  recovery cases where relevant;
- model refusal, tool denial, product containment, and user recovery are
  reported as separate evidence;
- no security, adoption, traffic, or star claim outruns the evidence;
- the packet ends with `Not covered` and one bounded review ask.

