# Prompt injection protection

> Screen prompts for injection and jailbreak attempts, log them or block them, and review every attempt caught.

Product: AI Cost Optimizer Gateway (ACOG). Web version: https://tessarac.com/docs/acog/govern/prompt-injection. Last updated: 2026-10-16.

ACOG screens prompts for attempts to override a model's instructions: instruction overrides, role and persona hijacks, attempts to extract the system prompt, guardrail evasion and delimiter injection.

**Screening is on by default, in log-only mode.** Attempts are recorded and requests go through unchanged until you choose to block.

## Settings

Open **Admin → Governance → Prompt security**. Changing the setting requires **Manage data-loss-prevention rules and connect source code** (`admin:security`).

| Setting | Effect |
|---|---|
| **Screen prompts for injection attempts** off | Prompts are sent with no screening, and nothing is recorded |
| On, **Log only** | Every prompt is screened; attempts are recorded and the request continues |
| On, **Block the request** | Every prompt is screened; an attempt is refused before it reaches the model |

The mode can also be set per team and per API key. The most specific setting wins: key, then team, then organization.

## What a blocked request gets

```json
{
  "error": {
    "type": "prompt_injection_blocked",
    "message": "…",
    "category": "instruction_override"
  }
}
```

The status is `400`. Blocks are delivered as the `governance.guardrail_blocked` [webhook](https://tessarac.com/docs/acog/administer/webhooks.md) event.

## Reviewing attempts

The **Injection attempts** log on the same page lists every attempt caught, with its category and who sent it. It is visible to holders of `admin:security`.

## Where it applies

Prompt screening runs on the compatible endpoints and the native routes. It does not run on embeddings requests.
