Conversation
"Hold every outbound send for review" was only expressible by composing an allowlist gate with an empty list and action=review: nothing matches, so the non-match action fires for every send. That overloads "nothing matched" to mean "we decided to hold", and an empty allowlist looks like an unfinished trust ramp instead of a deliberate posture (issue tokencanopy#989). Add an explicit outbound.require_review boolean to the protection resource. When set, the recipient gate holds every send for review whatever the gate policy, allowlist, or non-match action says. The empty-allowlist composition keeps working unchanged. The switch lands across the OpenAPI spec and both generated SDK bases, the MCP update_protection tool, the CLI --outbound-review toggle, the dashboard ProtectionEditor, and a shared contract scenario. The agent setup guidance now points at the flag rather than the empty-allowlist trick.
The setup guidance in plugins/e2a changed to prefer outbound.require_review over the empty-allowlist composition, so the plugin needs a release bump per the version gate. Regenerated manifests from plugin.meta.json and moved the release-version assertions in the packaging and email-evals contract tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #989.
"Hold every outbound send for review" had no direct spelling. The outbound gate is a policy plus an action on non-match, and
openmatches every recipient, soaction: reviewholds nothing. The only way to get there was an allowlist policy with an empty list: nothing matches, so the non-match action fires for every send. That expresses a deliberate posture as an accident of matching, and it's hard to tell apart from an unfinished trust ramp. It also broke the clients in small ways — the CLI's--outbound-review onhad to force the content scan on so that something would hold.This adds an optional
outbound.require_reviewboolean to the account-scoped protection resource. When it's true, the recipient gate holds every send for review whatever the gate policy, allowlist, or configured non-match action says, sogate.policycan stayopen. The gate'sprotection_eventsrow now records the action that actually applied (review) rather than echoingoutbound_policy_action; for every existing config the two are identical.The old composition still works and is still covered by
hitl_send_holds_202. I left it alone because deployed agents are configured with it and migration 042 forwards the retiredhitl_mode=allonto it. The flag lives on the outbound direction only (ProtectionOutboundView/ProtectionOutboundRequest), so the wire schema doesn't advertise a knob the inbound direction ignores.Client surface checklist
PUT /v1/agents/{email}/protection; store, handler, and DB-backed send-path tests125_outbound_require_review.sql, one additiveBOOLEAN NOT NULL DEFAULT falsecolumn, no backfillmake generateis clean)--outbound-review on|offwritesrequire_review; the pre-existing scan bump ononis left as it wasmcp/src/tools/—update_protectiongainsoutbound_require_review; no new tool, so the registry assertion is unchangedThe web dashboard isn't in the template but is part of the posture:
ProtectionEditorgets the "Always require human review" checkbox, and it now round-trips the field. Without that, editing any other protection setting would have silently clearedrequire_review, because the editor builds the outbound body from scratch on save.Operational risk
Additive and off by default, so no existing agent's posture changes. No change to the send path for agents that don't set the flag. The flag overrides the gate, not the scan: a message that crosses the scan block threshold is still blocked, not held.
Test plan
screenOutboundnot honoring it,TestDeliverOutbound_RequireReviewHoldsEverySendfails withHeld:false ... Status:accepted— the send went straight out, which is what the reporter saw. It passes after the gate change.go test ./internal/identity/ ./internal/agent/ ./internal/httpapi/ -count=1 -p 1— all passmake spec-check,make openapi-compat-check(no breaking changes vsorigin/main),make generate-sdk-checkgo test -tags integration ./tests/contract/ -run TestScenarios— includes the newoutbound_require_review_holds_202cmd/e2a-contract-server— both pass. The TS and Python runners skip scenarios whose setup needs a store-verified domain, sooutbound_require_review_holds_202is skipped there exactly like the pre-existinghitl_send_holds_202; the Go runner executes it, and the handler/store tests cover it directly.npm testin@e2a/sdk,@e2a/cli,@e2a/mcp-server;cd web && npx tsc --noEmit && npm run lint && npm run test:coverage(1096 tests)pytest tests/(605 passed) andmypyOne local note:
make fmt-checkreports drift ininternal/agent/selfsend.go,internal/hitlworker/worker.go, andinternal/senderidentity/worker.go. Those are untouched by this branch and are a gofmt difference between the local Go 1.27 and the CI's Go 1.26; the touched files are clean.