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

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).
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).

`block_entities` stops the run regardless of the `action` setting. For an observe-only `action: 'log'` setup, also set `block_entities` to `[]`.

Expand Down
10 changes: 5 additions & 5 deletions docs/middleware/budget-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Once the provider replies, the middleware prices the spend recorded against the

### Pricing

A built-in table prices common models from Anthropic, OpenAI, Google, xAI, DeepSeek, and Mistral, in US dollars per million tokens. The middleware matches a model ID exactly first, then by the longest pricing key it starts with or contains. A dated or gateway-prefixed id such as `us.anthropic.claude-3-5-haiku-20241022-v1:0` or `bedrock/gpt-4o-mini-2024-07-18` still resolves to its family.
A built-in table prices common models from Anthropic, OpenAI, Google, xAI, DeepSeek, and Mistral, in US dollars per million tokens. The middleware matches a model ID exactly first, then by the longest pricing key it starts with or contains. A dated or gateway-prefixed ID such as `us.anthropic.claude-3-5-haiku-20241022-v1:0` or `bedrock/gpt-4o-mini-2024-07-18` still resolves to its family.

Published pricing changes faster than this package releases. Override or extend it:

Expand All @@ -148,8 +148,8 @@ new BudgetGuard(

<Warning>
When no pricing is known for a step's model, `unknownModelAction` decides what happens:
`allow` (the default) logs the gap and lets the request through unmetered, while `block`
stops the run so an unpriced model can never spend against a budget unchecked.
`allow` (the default) logs the gap and lets the request through unmetered. `block` stops
the run so an unpriced model can never spend against a budget unchecked.

```php
new BudgetGuard(unknownModelAction: 'block')
Expand All @@ -170,8 +170,8 @@ new BudgetGuard(action: 'log') // observe before enforcing

<Warning>
`truncate` only applies to the per-request budget. Shrinking the current prompt cannot undo
spend already recorded against a session or a user's day, so a session or daily breach
degrades to `block` regardless of the configured action.
spend already recorded against a session or a user's day. A session or daily breach
therefore degrades to `block` regardless of the configured action.
</Warning>

## Blocked runs
Expand Down
6 changes: 3 additions & 3 deletions docs/middleware/tool-approval-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ new ToolApprovalGuard(

### Secret-like data

The middleware runs the same detectors as [PII Redactor](/middleware/pii-redactor), including the Luhn check on card numbers. By default it scans for **only three entities**: `credit_card`, `api_key` and `bearer_token`.
The middleware runs the same detectors as [PII Redactor](/middleware/pii-redactor), including the Luhn check on card numbers. By default it scans for **only three entities**: `credit_card`, `api_key`, and `bearer_token`.

Entities listed in `block_entities` stop the run regardless of the configured action, matching PII Redactor's behaviour.

Expand All @@ -102,8 +102,8 @@ Entities listed in `block_entities` stop the run regardless of the configured ac

Exfiltration is about **destination**, not presence, and the destination
cannot be judged from the value alone. Adding `email`, `phone`, `url`,
`ip_address` or `mac_address` will flag legitimate calls made by any agent
that owns a mail, SMS or HTTP tool.
`ip_address`, or `mac_address` will flag legitimate calls made by any agent
that owns a mail, SMS, or HTTP tool.

To control *where* a tool may send data, use `allowed_tools` /
`denied_tools` and domain allowlisting inside the tool itself.
Expand Down
Loading