Two Distinct Enforcement Points in the Request/Response Pipeline
Prompt firewalls and output firewalls are not interchangeable terms for the same control. Neither term is formally defined by OWASP, NIST, or MITRE, but both describe stage-based enforcement that maps cleanly to documented risk categories. A prompt firewall sits before the model call and evaluates user input, system instructions, and retrieved context for manipulation patterns. An output firewall sits after generation and evaluates the model's response before it reaches a user, application, or downstream system. The distinction matters operationally: a control placed at one point in the pipeline has no visibility into content or behavior that only exists at the other.
Prompt Firewall vs Output Firewall
| Dimension | Prompt Firewall | Output Firewall |
|---|---|---|
| Enforcement point | Before the model call | After generation, before delivery |
| Inspects | User input, system instructions, retrieved context | Model-generated responses |
| Primary threats | Prompt injection, jailbreak attempts | Sensitive disclosure, system prompt leakage, improper output handling |
| OWASP LLM alignment | LLM01 (Prompt Injection) | LLM02, LLM05, LLM07 |
| Visibility limit | Cannot see generated content | Cannot undo upstream manipulation of model reasoning |
Threat Coverage Mapped to Documented Risk Categories
The OWASP Top 10 for LLM Applications provides a useful reference for scoping each control. Prompt Injection (LLM01) is fundamentally an input-stage problem: a prompt firewall can inspect and block crafted input before it reaches the model. Sensitive Information Disclosure (LLM02), Improper Output Handling (LLM05), and System Prompt Leakage (LLM07) are output-stage problems, since the disclosure only exists once the model has generated a response.
Excessive Agency (LLM06), which covers agents with excessive permissions or unsafe tool calls, falls outside both categories. It requires validating the action an agent attempts to take, not the text it produces or receives, which is why agentic systems need a third enforcement surface beyond content inspection.
Where Single-Stage Enforcement Fails
Deploying only a prompt firewall leaves output-only risks unaddressed. A model can generate leaked system instructions or disclose sensitive data without any adversarial input having triggered it, and input-stage inspection has no visibility into that generated content. Deploying only an output firewall has the opposite gap: by the time a response is generated, any injected instructions have already influenced the model's reasoning, so output inspection can catch the resulting disclosure but cannot undo the manipulation that produced it.
Joint CISA and NSA guidance on deploying AI systems recommends validating and monitoring both inputs and outputs as part of a defense-in-depth approach, rather than relying on a single control point. NIST's AI RMF reinforces this through its Govern function, which calls for documented accountability over where controls are enforced across the system lifecycle, not just at one checkpoint.