Generate a mailbuttons.policy.json
mailbuttons_generate_policyGenerates a valid MailPolicy JSON file from an allow/block list, defaulting to bounce and capped at internal sending. Use it to define which senders an agent accepts and how far it may send.
Instructions
Build-time, sandbox-only. Turns an allow/block description into a valid MailPolicy and writes mailbuttons.policy.json. Default-bounce (closed by default), capped at internal send, with a prompt-injection content guard. Never invents senders and never generates external-send capability — going external is a human promotion.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"allow": "<allow>",
"sendScope": "<sendScope>"
},
"name": "mailbuttons_generate_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allow | Yes | Senders the agent should accept mail from. Each entry is matched by address OR domain. Only list senders the user actually named — never invent any. | |
| block | No | Senders to explicitly reject. With defaultAction 'bounce' anything not allowlisted is already rejected, so these are usually redundant; they are surfaced as warnings rather than silently expanding the policy. | |
| outPath | No | Where to write the policy. Defaults to ./mailbuttons.policy.json. | |
| sendScope | Yes | How far the agent may send. 'internal_only' grants send_internal to allowed senders; 'none' grants no send capability. External send is NEVER generated — it requires a human promotion. | |
| contentGuards | No | Extra body-regex guards to add on top of the default prompt-injection guard. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path the policy file was written to. | |
| policy | Yes | The generated MailPolicy, exactly as written to disk. | |
| warnings | Yes | Non-fatal notes (e.g. redundant block entries, empty allowlist). |