Enforce Agent Rules
Enforcement is level 2 of SilentShield's AI Agent Control: instead of only recording AI agent visits, your server or edge actively applies your per-key policy — each agent is allowed, throttled, or blocked. It builds directly on observe mode. The enforcement components (Next.js middleware, sidecar binary, Cloudflare Worker) are currently provided on request during early access — contact [email protected].
Observe First, Then Enforce
Our clear recommendation: enable observation first, let it run for a week or two, and review the report before you block anything — the same staged rollout as Wordfence's learning mode or DMARC (none → quarantine → reject). Only the report shows which AI services actually visit your site and what a block would cost you, for example citations in AI search. Enforcing without that picture means deciding blind.
How Enforcement Works
Every enforcer shares the same contract: it fetches a policy bundle for your API key, verifies the bundle's Ed25519 signature against SilentShield's pinned public keys, and then decides locally — allow, deny, or throttle — without any call on the request path.
You fetch the pinned signing keys once from https://api.silentshield.io/.well-known/silentshield-agent-keys. And every enforcer fails open: on any error — network, signature, expired bundle — the request is let through. Enforcement can never take your site down.
Setups
Next.js (Edge Middleware)
The same Next.js adapter that observes can also enforce. Set the policy environment variables; the middleware then applies your policy at the edge:
AGENT_POLICY_URL=https://api.silentshield.io/api/v1/agent/policy
AGENT_OBSERVE_API_KEY=YOUR_API_KEY
AGENT_TRUSTED_KEYS=[{"kid":"…","key":"<base64 ed25519 pubkey>"}]Reverse Proxy (nginx / Caddy / Traefik)
One tiny sidecar binary serves all three proxies: the proxy asks it once per request via forward auth. Start it with your site key and the trusted keys:
AGENT_POLICY_URL="https://api.silentshield.io/api/v1/agent/policy" \
AGENT_SITE_KEY="YOUR_API_KEY" \
AGENT_TRUSTED_KEYS='[{"kid":"…","key":"<base64 ed25519 pubkey>"}]' \
AGENT_SIDECAR_LISTEN=":8127" \
./agent-sidecarThe sidecar answers on GET /auth with 204 (allow), 403 (deny), or 429 plus Retry-After (throttle). Wire it into your proxy:
location = /_ss_auth {
internal;
proxy_pass http://127.0.0.1:8127/auth;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Signature $http_signature;
proxy_set_header Signature-Input $http_signature_input;
proxy_set_header Signature-Agent $http_signature_agent;
}
location / {
auth_request /_ss_auth;
# ... your normal proxy_pass to the origin ...
}example.com {
forward_auth 127.0.0.1:8127 {
uri /auth
copy_headers User-Agent Signature Signature-Input Signature-Agent
# Caddy sends X-Forwarded-Method/-Uri/-Host automatically
}
reverse_proxy origin:8080
}http:
middlewares:
silentshield:
forwardAuth:
address: "http://agent-sidecar:8127/auth"
authRequestHeaders:
- "User-Agent"
- "Signature"
- "Signature-Input"
- "Signature-Agent"Cloudflare Worker
The Cloudflare Worker enforcer verifies the policy bundle with Web Crypto Ed25519 and blocks before requests ever reach your origin:
cd enforcers/cloudflare-worker
npx wrangler secret put AGENT_SITE_KEY
# set AGENT_POLICY_URL + AGENT_TRUSTED_KEYS in wrangler.toml [vars]
npx wrangler deployHonest Limits
Agentic browsers on residential IP addresses (Comet, ChatGPT Atlas, and similar) are technically indistinguishable from human visitors. No product can reliably identify them — SilentShield therefore deliberately makes no enforcement promise for this category.
robots.txt and emitted content signals are advisory: well-behaved crawlers follow them, but nothing forces them to. Technical enforcement happens only in the enforcers on this page — and even they act conservatively, denying only positively identified known agents so that legitimate visitors are never blocked.
Configure Your Policy
Which agent may do what is configured per API key in the agent hub: API Keys → select a key → Agent. Presets cover the common cases; every change becomes a newly signed bundle that your enforcers pick up automatically.