Skip to content

feat(agent): port the prompt-injection defenses from Decepticon (Phase 2b-ii, middleware) - #4

Merged
PurpleCHOIms merged 1 commit into
mainfrom
feat/agent-middleware-port
Oct 26, 2026
Merged

PurpleCHOIms merged 1 commit into
mainfrom
feat/agent-middleware-port

Conversation

@PurpleCHOIms

Copy link
Copy Markdown
Member

First implementation PR of the agent runtime (design doc).

Ports the two defender-critical middleware layers with their original behavioral tests (1,186 lines of tests travel with them — no behavior re-derivation):

  • UntrustedOutputMiddleware — quarantine ledger + injected system policy for untrusted tool output (AuditSink abstraction carried; AutoBot wires a file sink at its state dir when the graph lands)
  • PromptInjectionShieldMiddleware — deny-listed tool-output wrapping, unicode tag-smuggling detection/stripping, trusted-internal-tool resolution; the skills-registries tests adapted to AutoBot's steady state (no registries → documented fallback)
  • _injection_detector — shared detector, stdlib only

Package deps gain the LangChain runtime (agent layer only — the contract layer stays langchain-free; TID251 scope extended to autobot/agent/**). Decepticon's slot-registry test replaced with steady-state fallback coverage; the assembly wiring test lands with the blue_cell graph (next PRs: thin factory → graph+server+compose).

223 unit tests passed; make ci-lint clean.

…e 2b-ii, middleware)

Port the two defender-critical middleware layers with their original
behavioral tests (1,186 lines of tests travel with them):

- UntrustedOutputMiddleware — quarantine ledger + injected system policy for
  untrusted tool output (carries the AuditSink abstraction; AutoBot wires a
  file sink at the AutoBot state dir when the graph lands)
- PromptInjectionShieldMiddleware — deny-listed tool-output wrapping, unicode
  tag-smuggling detection/stripping, trusted-internal-tool resolution with
  the documented fallback (AutoBot's steady state: no skills registries)
- _injection_detector — the shared detector (stdlib only)

Package deps gain the LangChain runtime (agent layer only — the contract
layer stays langchain-free, TID251 scope extended to autobot/agent/**).
Decepticon's slot-registry test replaced with AutoBot-steady-state fallback
coverage; the assembly wiring test lands with the blue_cell graph.

223 unit tests passed in the middleware suite.
@PurpleCHOIms
PurpleCHOIms merged commit a9f77cd into main Oct 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant