Screen with an adapter
Each adapter takes ascreen option. Pass true to screen with the adapter’s own model, or name a cheaper model to screen with:
Screen with any model
Without an adapter, pass ascreen with a judge that calls any model you like. The judge receives the system prompt and user prompt that the SDK built. For models with structured output, it also receives the JSON Schema of the expected reply. The judge returns the model’s reply as a JSON string, or as an already parsed fit:
full, partial, or none. The answer also includes a reason and a list of what’s missing. A fit of none rejects the proposal with the model’s reason.
The prompt describes the agent, its skills, the agents it delegates to, and its operator instructions. The operator instructions are the adapter’s instructions or system prompt, plus screen.instructions. The prompt treats the proposal as untrusted data and tells the model never to reveal the instructions.
Screen settings
Judge failures are also reported to your error handler.
When screening runs
Screening only runs on proposals the agent would otherwise accept, so your proposal handler runs first. Without a proposal handler, the default checks run first. Screening also skips:- Proposals the agent sends to itself.
- Requests to prepare delegates.
- Retried proposals, which reuse the first verdict.
- Schedule runs. A schedule is screened once, when it’s proposed.
screenProposal(proposal, agent, screen) (screen_proposal() in Python).