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
4 changes: 2 additions & 2 deletions docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ Supported actions:
1. block
2. log

Unlike the PII Redactor, `entities` defaults to only the high-risk set: `credit_card`, `api_key` and `bearer_token`. Contact data and locators are supported but opt-in. In a proposed tool argument, they are usually the tool's own parameters rather than an exfiltration signal. `scan_injection` is off by default for the same reason. See the [Tool Approval Guard guide](/middleware/tool-approval-guard#secret-like-data).
Unlike PII Redactor, `entities` defaults to only the high-risk set: `credit_card`, `api_key` and `bearer_token`. Contact data and locators are supported but opt-in. In a proposed tool argument, they are usually the tool's own parameters rather than an exfiltration signal. `scan_injection` is off by default for the same reason. See the [Tool Approval Guard guide](/middleware/tool-approval-guard#secret-like-data).

Note that `block_entities` stops the run whatever `action` is set to, so `action: 'log'` is only observe-only if you also set `block_entities` to `[]`.

This middleware acts on the response rather than the prompt, because the model proposes the tool calls it guards. It has no mutating action, since a proposed tool call belongs to the paused turn the provider recorded.

## Tool approval resumes

When an agent pauses for tool approval and is resumed with `Decisions`, the prompt text is empty. The new content is whatever a human supplied while resolving the pending tool calls: edited tool arguments and rejection results.
When an agent pauses for tool approval and you resume it with `Decisions`, the prompt text is empty. The new content is whatever a human supplied while resolving the pending tool calls: edited tool arguments and rejection results.

Intercept scans that content by default, before the SDK applies the decisions and runs any approved tool call. Resumed prompts cannot be rewritten, so actions that modify the prompt degrade to logging on this path:

Expand Down
7 changes: 3 additions & 4 deletions docs/contributor-resources/support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ sidebarTitle: "Support utilities"

`promptphp/intercept-support` provides shared support utilities and configuration for the Intercept middleware ecosystem.

Users do not need to install or use this package directly. Composer installs it automatically when an Intercept middleware package requires it.
You do not need to install or use this package directly. Composer installs it automatically when an Intercept middleware package requires it.

The support package provides shared infrastructure used across Intercept packages, including:

- the shared `config/intercept.php` configuration file
- the `intercept-config` publish tag

- the `InterceptServiceProvider` for Laravel package registration
- the Intercept base exception class

Expand Down Expand Up @@ -51,11 +50,11 @@ The helper merges the published config section with the middleware's internal de

Missing config sections are safe.

For example, a user may publish `config/intercept.php` while only using Injection Guard. If they later install PII Redactor, their existing config file may not contain a `pii_redactor` section.
For example, you may publish `config/intercept.php` while only using Injection Guard. If you later install PII Redactor, your existing config file may not contain a `pii_redactor` section.

That is fine. PII Redactor will still work using its internal defaults.

Users only need to add a middleware section to `config/intercept.php` when they want to customise global behaviour.
You only need to add a middleware section to `config/intercept.php` when they want to customise global behaviour.

## Service provider

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/security-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ It cannot change what the SDK stores. The conversation store keeps the original

This matters most for indirect prompt injection. If a tool fetches a web page, reads a document, or queries a record that contains injected instructions, that content is handed to the model without passing through Intercept.

Tool Approval Guard narrows that gap but does not close it. It inspects what the model *proposed* after reading poisoned content, which is where the damage usually surfaces, but it cannot inspect the poisoned content itself. It also only applies to tools that are approval-gated. A tool that runs without approval is never inspected.
Tool Approval Guard narrows that gap but does not close it. It inspects what the model *proposed* after reading poisoned content, which is where the damage usually surfaces. It cannot inspect the poisoned content itself. It also only applies to tools that are approval-gated. A tool that runs without approval is never inspected.

Guard those surfaces separately:

Expand All @@ -112,7 +112,7 @@ Guard those surfaces separately:

## Tool approval resumes

When a paused run is resumed with `Decisions`, the prompt text is empty. The new content is what a human supplied while resolving the pending tool calls, and Intercept scans it. The scan runs before the SDK executes any approved or edited tool call.
When you resume a paused run with `Decisions`, the prompt text is empty. The new content is what a human supplied while resolving the pending tool calls, and Intercept scans it. The scan runs before the SDK executes any approved or edited tool call.

Two limits are worth knowing.

Expand Down
14 changes: 7 additions & 7 deletions docs/middleware/pii-redactor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ composer require promptphp/intercept-pii-redactor
```

<Tip>
If you prefer to install the main intercept package to get the full middleware collection, run:
If you prefer to install the main Intercept package to get the full middleware collection, run:
</Tip>

```bash
Expand Down Expand Up @@ -96,7 +96,7 @@ Names, addresses, passports, national insurance numbers, and medical identifiers

No configuration is required. The middleware works out of the box using safe internal defaults.

The defaults may be overridden via the constructor or via the shared `config/intercept.php` file, published with:
You can override the defaults via the constructor or via the shared `config/intercept.php` file. Publish it with:

```bash
php artisan vendor:publish --tag=intercept-config
Expand All @@ -106,7 +106,7 @@ Explore the [configuration guide](/configuration) for more details on how to con

### Configuration priority

Configuration is resolved in this order:
Intercept resolves configuration in this order:

```mermaid placement="top-right"
flowchart LR
Expand Down Expand Up @@ -265,7 +265,7 @@ public function middleware(): array
If PII is detected, the middleware throws a `PIIRedactorException`.

<Tip>
You may also catch the parent exception class `InterceptException` throwable by all Intercept middleware.
You can also catch `InterceptException`, the parent exception class that all Intercept middleware throw.
</Tip>

```php
Expand Down Expand Up @@ -461,11 +461,11 @@ public function middleware(): array
}
```

When a callback is provided, it takes priority over the configured action.
When you provide a callback, it takes priority over the configured action.

## Tool approval resumes

When an agent pauses for tool approval, the run is resumed by passing `Decisions` back to the agent instead of a new prompt.
When an agent pauses for tool approval, you resume the run by passing `Decisions` back to the agent instead of a new prompt.

A resumed prompt carries no prompt text. The only new content is what a human supplied while resolving the pending tool calls:

Expand Down Expand Up @@ -547,7 +547,7 @@ public function middleware(): array
```

<Warning>
Detection offsets on this path are relative to the decision value the detection was found in, not to the prompt. Offsets exist to drive redaction, which cannot be applied to a resumed run, so custom callbacks should use the detection `type` and `value` rather than `start` and `length`.
Detection offsets on this path are relative to the decision value the detection was found in, not to the prompt. Offsets exist to drive redaction, which cannot apply to a resumed run. Custom callbacks should therefore use the detection `type` and `value` rather than `start` and `length`.
</Warning>

## Production rollout
Expand Down
Loading