Secret guard
Do not forward a code you just received.
A deterministic check on outbound email. Markdown: /docs/secret-guard.md · secret_not_allowed.
What is detected
Secret guard looks at codes and verification links already extracted from this inbox's inbound email in the last 7 days, up to the newest 200 inbound messages. It uses the same code scan and the same verification-link scan as wait-for-code. A match is the code as a whole token, or the link as an exact URL, its query string, a long path token, or a token parameter of 16 characters or more.
The check also looks through quoted-printable, percent-encoding, HTML entities, and standard base64 of the code or link. It does not write a second code pattern.
Who may receive them
A received secret may be sent to an address on the same registrable domain as the sender (the last two labels of the domain, so a subdomain or the parent domain matches), to any inbox on this account including a custom-domain inbox, or to a verified owner email on the account. Pending owners are not included.
If every To, Cc, and Bcc address is allowed, the send is unchanged. One outsider in the list is enough to block or warn, and blocked_recipients lists only those addresses.
block, warn, and off
secret_guard is an account setting: block, warn, or off. New accounts are block. Accounts created before 2026-12-05 have a null value, which reads as warn until you change it. warn sends the message and adds warnings to the /api/v1 send, reply, reply-all, forward, and draft-send JSON. off does not check. /v0 warn does not add a field. /v0 block returns 403 in the /v0 error shape.
block refuses the send before it is queued, delivered, or counted. Nothing is stored as an outbound message. HTTP 403 secret_not_allowed includes blocked_recipients and an action. The secret value is never in the response. A scheduled send that is blocked at dispatch is marked failed with send_error secret_not_allowed. A send a verified owner approved is exempt, because a person decided the exact message. SMS is not checked.
Any live API key can set the mode with PATCH /api/v1/me, including an inbox-scoped key. cooper_whoami accepts the same field.
curl -s -X POST https://cooperemail.com/api/v1/inboxes/$INBOX/messages \
-H "Authorization: Bearer $COOPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["other@example.com"],"subject":"the code","text":"forwarding a code this inbox received"}'
# HTTP 403
# {"error":{"type":"authentication_error","code":"secret_not_allowed","message":"This message includes a verification code or sign-in link this inbox received. It was not sent.","param":"to","blocked_recipients":["other@example.com"],"action":"Send it to the owner or the service that sent the code, or ask the owner to change secret_guard.","docs_url":"https://cooperemail.com/docs#secret_not_allowed"}}
curl -s -X PATCH https://cooperemail.com/api/v1/me \
-H "Authorization: Bearer $COOPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"secret_guard":"block"}'Limits
This is a deterministic match, not a DLP system. A paraphrased code such as one two three is not caught. Mail older than 7 days is ignored. Only email is covered. SMS is out of scope.
The value of the code or link is not returned, logged, or written into the audit row. The audit action, when a send is blocked, is secret_guard.blocked.