Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_injection-defense-flow

Prompt injection defense flow (least-privilege tool calls)

13 COMPONENTS · 18 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![Prompt injection defense flow (least-privilege tool calls) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_injection-defense-flow/opengraph-image)](https://archos.sageideas.dev/d/dgm_injection-defense-flow)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_injection-defense-flow)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_injection-defense-flow" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Prompt injection defense flow (least-privilege tool calls) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Web Client")]
  model_1["Inference server"]
  web_2[("Web page source")]
  gw_3["API gateway"]
  orch_4[("Agent orchestration runtime")]
  gin_5["Guardrails"]
  pdp_6["Policy decision point (PDP)"]
  tools_7["Function calling"]
  secrets_8[("Secrets manager")]
  audit_9[("Audit log")]
  tsdb_10[("Time-series database (TSDB)")]
  alerting_11[("Alerting")]
  capacity_12["Capacity Estimate"]
  client_0 -->|"1. Calls with JWT · HTTPS"| gw_3
  gw_3 -->|"2. Forwards (mTLS) · HTTP/2"| orch_4
  orch_4 -->|"3. Sends prompt · HTTPS"| model_1
  model_1 -->|"4. Proposes tool call · HTTPS"| orch_4
  orch_4 -->|"5a. Asks policy (mTLS) · HTTP/2"| pdp_6
  orch_4 -->|"5b. Checks call · HTTP/2"| gin_5
  pdp_6 -->|"6a. Returns decision · HTTP/2"| orch_4
  gin_5 -->|"6b. Returns verdict · HTTP/2"| orch_4
  orch_4 -->|"7. Calls tool (mTLS) · HTTP/2"| tools_7
  tools_7 -->|"8. Fetches pages · HTTPS"| web_2
  web_2 -->|"9. Returns page · HTTPS"| tools_7
  tools_7 -->|"10. Returns marked data · HTTP/2"| orch_4
  orch_4 -->|"11. Sends answer, unchecked · HTTP/2"| gw_3
  gw_3 -->|"12. Relays answer · HTTPS"| client_0
  orch_4 -->|"Exports (OTLP) · OTLP"| tsdb_10
  tsdb_10 -->|"Feeds Alerting · HTTP"| alerting_11
  orch_4 -->|"Writes audit log · HTTP/2"| audit_9
  secrets_8 -->|"Supplies tool keys · HTTPS"| tools_7

COMPONENT STACK (12)

  • Web ClientSTATEFUL
    Asks to read an allowlisted page
  • Inference serverSTATELESS
    Hosted model API outside our boundary
  • Web page sourceSTATEFUL
    Untrusted pages; may hide instructions
  • API gatewaySTATELESS
    Checks the JWT, then forwards
  • Agent orchestration runtimeSTATEFUL
    Marks fetched text as data; obeys each verdict
  • GuardrailsSTATELESS
    Screens the proposed call; fails closed
  • Policy decision point (PDP)STATELESS
    Allows or denies per user and tool
  • Function callingSTATELESS
    Runs allowed tools; SSRF defenses on fetches
  • Secrets managerSTATEFUL
    Holds tool keys; the model never sees them
  • Audit logSTATEFUL
    Records each tool decision
  • Time-series database (TSDB)STATEFUL
    Stores denials, blocks and fetch refusals
  • AlertingSTATEFUL
    Pages on-call when denials or blocks spike

REQUEST & DATA FLOW (18)

  1. Web Client → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Agent orchestration runtime (Forwards (mTLS))[HTTP/2]
  3. Agent orchestration runtime → Inference server (Sends prompt)[HTTPS]
  4. Inference server → Agent orchestration runtime (Proposes tool call)[HTTPS]
  5. Agent orchestration runtime → Policy decision point (PDP) (Asks policy (mTLS))[HTTP/2]
  6. Agent orchestration runtime → Guardrails (Checks call)[HTTP/2]
  7. Policy decision point (PDP) → Agent orchestration runtime (Returns decision)[HTTP/2]
  8. Guardrails → Agent orchestration runtime (Returns verdict)[HTTP/2]
  9. Agent orchestration runtime → Function calling (Calls tool (mTLS))[HTTP/2]
  10. Function calling → Web page source (Fetches pages)[HTTPS]
  11. Web page source → Function calling (Returns page)[HTTPS]
  12. Function calling → Agent orchestration runtime (Returns marked data)[HTTP/2]
  13. Agent orchestration runtime → API gateway (Sends answer, unchecked)[HTTP/2]
  14. API gateway → Web Client (Relays answer)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →