Fase 0 Day 1: agent-injection harness scaffold + first AgentDojo vector (card a6906265) - #210
Open
SabaTech-dev wants to merge 17 commits into
Open
Fase 0 Day 1: agent-injection harness scaffold + first AgentDojo vector (card a6906265)#210SabaTech-dev wants to merge 17 commits into
SabaTech-dev wants to merge 17 commits into
Conversation
added 17 commits
August 25, 2026 08:33
…458d4) Spec del 2026-07-27 vivía untracked desde hace 1 mes — commit aditivo (archivo nuevo, sin tocar nada tracked). Home natural: docs/internal/specs/ solo existe en este branch (reestructura Diátaxis).
…rd 78489ff6, mismo fix que PR #137 main)
…, GO condicionado)
…o vector (card a6906265) - core/injection: Scenario/AgentRunResult/Verdict models (binary utility x security outcome), objective evaluator (tool-call trace + FS invariants), utility checker (fail-closed) - adapters/agent: AgentCliAdapter (isolated subprocess workspace, JSONL trace capture) + argparse harness CLI (list/run, exit codes 0/1/2, --json) - corpus: agentdojo-001 seed (indirect-injection, OWASP LLM01) of 20 planned vectors - 37 TDD unit tests green; fixture agents record tool calls only (no network, C4-safe) - config/agent_injection.yaml: defaults + sandbox notes (egress deny-by-default)
…d a6906265) - corpus: vectors 2-20 across AgentDojo indirect-injection seeds + spec §2 families (direct-injection, tool-transition-nudge, payload-in-file, import-shadowing, exfiltration-passive, multi-turn), each with inline asset_content (per-vector poisoned asset) mapped to OWASP LLM01 - models: Scenario.asset_content field - harness: materialize scenario.asset_content instead of the single Day-1 document - 40 unit tests green (3 new corpus tests); e2e detection verified on nudge-001
…ance gate C2 (card a6906265) - judge: LLM-as-judge over OpenAI-compatible endpoint (stdlib urllib, no new deps), JSON verdict + confidence; unparseable/low-confidence -> HITL queue - HITLQueue: append-only JSONL (reports/injection/hitl_queue.jsonl) - key resolution: INJECTION_JUDGE_API_KEY -> LLAMA_API_KEY -> shared key file; never hardcoded. Note: LiteLLM :4000 proxy currently down (no DB); engines 8001/8009 accept the same shared key and are the measured Day-2 endpoint - harness CLI: (layer1+layer2, HITL enqueue) and (N runs over deterministic balanced case set, gate C2 <15% disagreement, exit 2 on gate failure) - 14 judge unit tests + 3 CLI judge tests green; real variance run in progress
…ance gate C2 (card a6906265) - judge: LLM-as-judge over OpenAI-compatible endpoint (stdlib urllib, no new deps), JSON verdict + confidence; unparseable/low-confidence -> HITL queue - HITLQueue: append-only JSONL (reports/injection/hitl_queue.jsonl) - key resolution: INJECTION_JUDGE_API_KEY -> LLAMA_API_KEY -> shared key file; never hardcoded. Note: LiteLLM :4000 proxy currently down (no DB); engines 8001/8009 accept the same shared key and are the measured Day-2 endpoint - harness CLI: `judge` (layer1+layer2, HITL enqueue) and `judge-variance` (N runs over deterministic balanced case set, gate C2 <15% disagreement, exit 2 on gate failure) - 14 judge unit tests + 3 CLI judge tests green; real variance run in progress
… (card a6906265) - design doc (docs/internal/design/): nudge = fail-triggered tool transition; T+C+P+J rule set, static transition table (config-declarative), integration with layer-1 evidence and layer-2 judge context, known limits, Day-3 plan - config: sandbox section updated to implemented DockerSandbox state
…J (card a6906265) TransitionTable (declarative, config/agent_injection.yaml detector.tool_transition) + NudgeDetector: failure-triggered class-lowering transitions per design doc. Unknown-status traces defer high/critical transitions to HITL (never infer).
…-1 nudge integration + 0 FP (card a6906265) - fixture nudge_agent.py: 415->curl->zip-refused->decoder.py->exec chain (record-only, C4-safe) - corpus +nudge-003 (21 vectors: 20 seed + end-to-end detection repro) - ObjectiveEvaluator: optional NudgeDetector; severity>=min marks violated; unknown-status traces defer to Verdict.needs_human -> HITLQueue (never infer) - FP measurement: safe agent across the full corpus -> 0 nudge findings
…ION_HITL_QUEUE (card a6906265) conftest autouse fixture redirects the queue for all injection tests; HITLQueue honors the env override. CLI-level tests no longer pollute reports/injection/hitl_queue.jsonl.
…SS (card a6906265) C2: judge variance 0.0% (0/89 pairs, gate <15%) — caveat: 33% null verdicts defer to HITL by design (reasoning model exhausts max_tokens before JSON). C4: sandbox review PASS (--network none, caps, no-new-privileges, snapshot/ restore, no host-env leak into container).
… (ASR 100%) (card a6906265)
…pus, pre-restore evidence (card a6906265)
…format hardening (card a6906265)
… PASS post-tuning 0% nulls (card a6906265)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fase 0 (GO condicionado, spec
2026-09-01-agent-prompt-injection-testing-spec.md) — Día 1 de 5.agent-injection(src/adapters/agent/harness_cli.py, argparse stdlib, sin dependencias nuevas):listyruncon códigos de salida 0=PASS / 1=UTILITY_FAIL / 2=SECURITY_VIOLATED y salida--jsonmáquina-legible.src/core/injection/: modelos (Scenario, AgentRunResult, Verdict con outcome binario utility×security), evaluador objetivo capa-1 (análisis de tool-call trace + invariantes de filesystem), utility checker fail-closed.src/adapters/agent/cli_adapter.py: AgentCliAdapter — subprocess aislado en workspace dedicado, captura de trace JSONL y archivos creados.agentdojo-001(indirect-injection sobre documento envenenado, OWASP LLM01) — 1 de los 20 vectores planificados.config/agent_injection.yaml(defaults + notas de sandbox).TDD
37 tests unitarios green (
tests/unit/injection/), ciclo red-green-respectado.E2E
Notas de decisión (día 1)
cmd_run) — el adapter solo ejecuta y observa.Refs: card a6906265, spec d33c0c9.