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/middleware/budget-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,6 @@ The cost estimate before the call is a character-based approximation unless you

Pricing changes faster than this package releases. Confirm the built-in rates against your provider's own pricing page and override the ones that matter to you.

The session and daily budgets are tracked in the cache, not the database, and reset on their own window rather than at a fixed clock boundary. They require a key resolver that can identify the session or the user. Without one, the middleware silently skips those budgets.
The middleware tracks the session and daily budgets in the cache, not the database. Each budget resets on its own window rather than at a fixed clock boundary. They require a key resolver that can identify the session or the user. Without one, the middleware silently skips those budgets.

When a run's model changes between steps, the per-request budget prices the earlier steps' accrued usage at the current step's rate, which is an approximation.
2 changes: 1 addition & 1 deletion docs/middleware/injection-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Intercept logs detections under a distinct message, `Prompt injection attempt de
]
```

The `degraded_from` key appears only when the configured action could not be applied. The `field` value is a dot path into the edited arguments, so nested values are reported precisely.
The `degraded_from` key appears only when the configured action could not be applied. The `field` value is a dot path into the edited arguments, so it pinpoints nested values precisely.

### Custom callbacks on a resumed run

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 @@ -335,7 +335,7 @@ This ignores other supported entity types.

### Allowing specific email addresses

Use `allowedEmails` when known safe email addresses should not be redacted or blocked.
Use `allowedEmails` when you want the middleware to ignore specific known safe email addresses.

```php
public function middleware(): array
Expand Down Expand Up @@ -522,7 +522,7 @@ The middleware logs detections found in approval decisions under a distinct mess

The `degraded_from` key appears only when the run continued despite a configured action that could not be applied. A blocked run never reports it.

The `field` value is a dot path into the edited arguments, so nested values are reported precisely, for example `arguments.filters.contact.email`.
The `field` value is a dot path into the edited arguments, so it pinpoints nested values precisely, for example `arguments.filters.contact.email`.

### Disabling approval decision scanning

Expand All @@ -548,7 +548,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 apply to a resumed run. Custom callbacks should therefore use the detection `type` and `value` rather than `start` and `length`.
Detection offsets on this path are relative to the decision value that contains the detection, 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
2 changes: 1 addition & 1 deletion docs/middleware/tool-approval-guard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Entities listed in `block_entities` stop the run regardless of the configured ac

A proposed argument that matches an injection pattern suggests that content the middleware never saw manipulated the model. It uses the same patterns as [Injection Guard](/middleware/injection-guard).

**This scan is off by default.** Prose a model writes for a human reader routinely contains phrases the patterns match, such as "You are now subscribed to weekly updates.", "From now on we will email you every Monday.", "System: scheduled maintenance at 3pm." None of those indicate manipulation in that context.
**This scan is off by default.** Prose a model writes for a human reader routinely contains phrases the patterns match. Examples include "You are now subscribed to weekly updates.", "From now on we will email you every Monday.", "System: scheduled maintenance at 3pm." None of those indicate manipulation in that context.

Enable it when a proposed argument feeds **another model or agent** rather than a person:

Expand Down
Loading