@caelaralabs/shield-mcp
v1.6.3
Published
Stdio MCP server for Caelara Shield by Caelara Labs: pre-execution security screening for agents. Prompt and output screening, SSRF-guarded fetch, and token and transaction screening. Stateless, zero runtime dependencies.
Maintainers
Readme
@caelaralabs/shield-mcp
Caelara Shield by Caelara Labs: a pre-execution firewall for AI agents, as an MCP server. Powered by Caelara Labs (https://caelaralabs.com) · Software that decides, never custody.
A stdio Model Context Protocol server that lets an agent check what it is about to read or do before it acts. It screens:
- prompts, documents and model outputs (direct and indirect prompt injection, hidden characters, secrets, personal data),
- outbound fetches (through an SSRF-guarded proxy),
- tokens, transactions and destination addresses (including address-poisoning lookalikes).
It only screens: it never builds, holds keys for, signs or submits anything. Plain Node ESM, zero runtime dependencies, Node 18 or newer.
Quickstart (10 seconds)
npx -y @caelaralabs/shield-mcp initSets up a trial key for this installation, adds the server to ~/.cursor/mcp.json (existing entries are kept, with a .bak copy) and checks that the Shield host answers. Pass --config <path> for any other MCP client that reads an mcpServers JSON file, or --dry-run to preview. Then run the server with:
npx -y @caelaralabs/shield-mcpRunnable examples
Clone the repository and run them with plain Node. No install step, no dependencies.
git clone https://github.com/caelara-labs/shield-mcp && cd shield-mcp
# Offline Ed25519 receipt verification: no key, no network
node examples/verify-receipt-offline.mjs
node examples/verify-receipt-offline.mjs --live # refresh the key set from /.well-known/jwks.json first
node examples/verify-receipt-offline.mjs <receipt|file> # verify your own receipt or signed pass
# Indirect prompt injection: a canary trap screened before any model sees it (uses your key from init)
node examples/canary-trap-check.mjs| Example | What it shows |
|---|---|
| examples/verify-receipt-offline.mjs | Checks a real network-signed receipt (a compact JWS, alg EdDSA) against a pinned copy of https://api.caelaralabs.com/.well-known/jwks.json, then shows a one-character change being rejected. Audits need no access to Caelara Labs. |
| examples/canary-trap-check.mjs | Builds a clean page and a trap page that hides an instruction and a unique canary token in an HTML comment behind zero-width characters, screens both with shield_scan_prompt's route, and adds a local canary-leak check for model output. |
$ node examples/verify-receipt-offline.mjs
key set: 2 Ed25519 keys (pinned copy, no network)
receipt: bundled sample, signed by oen-e507b0f5aef381b9
claims: execution_receipt · js · issued 2026-11-26T22:47:10.000Z
signature: VALID (checked locally in 1.4 ms)
tamper: one changed character -> rejected, as it should beLimits
Heuristic screening will miss attacks. No findings is not proof of safety: keep a person in the loop for anything irreversible.
Tools
| Tool | What it checks | Route |
|---|---|---|
| shield_preflight | Optional, once at start-up: your system prompt and tool descriptions (injection, tool poisoning, embedded secrets). Returns a clearance_id that later calls carry | POST /v1/shield/preflight |
| shield_scan_prompt | Untrusted input before it reaches a model: injection, hidden characters, personal data, secrets | POST /v1/shield/prompt |
| shield_validate_output | Model output before it is used: leakage, exfiltration links, active content, shell patterns | POST /v1/shield/output |
| shield_proxy_fetch | An https fetch through an SSRF-guarded proxy, with the body scanned | GET /v1/proxy/_?url=... |
| shield_audit_token | A token, a broadcast transaction hash, or a destination address (poisoning lookalikes) | POST /v1/shield/tx |
| shield_check_expenditure | A spend before your own payment service is called: limits, blocked categories, a merchant allow-list, an approval threshold and a screen of the merchant domain. Answers allow, escalate (with a single-use human approval) or block, with a hash-only signed clearance receipt. It never moves anything and refuses card numbers and wallet addresses | POST /v1/guard/spend-check on https://api.caelaralabs.com (CAELARA_EDGE_URL overrides it) |
Retired on 2026-11-22: shield_route_quote, shield_safe_swap and shield_universal_action. Caelara Shield no longer builds routes, orders or unsigned payloads; their REST routes answer 410 Gone. To check a token or transaction before signing, use shield_audit_token.
Configure
The screening tools call the live Caelara Shield host (https://shield.caelaralabs.com) with a Caelara key, sent as the X-Caelara-Key header: CAELARA_KEY if set, otherwise the key saved by init. Every Caelara key type works the same way, and the env block below is optional. Keys: https://caelaralabs.com
{
"mcpServers": {
"caelara-shield": {
"command": "npx",
"args": ["-y", "@caelaralabs/shield-mcp"],
"env": { "CAELARA_KEY": "your-key" }
}
}
}- Cursor:
.cursor/mcp.jsonin your project, or~/.cursor/mcp.json. - Desktop assistants and other stdio clients: add the same block to the client's
mcpServersconfiguration. - OpenClaw: copy
examples/openclaw/into your skills folder (for example~/.openclaw/skills/caelara-shield/). The skill calls the HTTP API withcurland needs no MCP setup.
Optional environment variables
CAELARA_SHIELD_URL: base URL (defaulthttps://shield.caelaralabs.com).CAELARA_SHIELD_TIMEOUT_MS: request timeout in milliseconds (default3000).CAELARA_CLEARANCE: optionalclearance_idfrom an earlier preflight, sent asX-Caelara-Clearance. Preflight is opt-in: nothing is called at start-up, and once the agent runsshield_preflightits clearance is sent with later calls in that session.CAELARA_NO_AUTO_TRIAL=1: never set up a trial key automatically.
Behaviour
- Stateless: nothing is written to disk except the saved key, and request and response bodies are never logged.
- Requests: every upstream request has a 3000 ms timeout and sends
User-Agent: CaelaraLabs-Engine/1.0. - Errors: failures come back as tool results with
isError: trueand a JSON body (timeout,network_error,upstream_error,invalid_arguments,payment_required). The server never throws to the client. - Keys: no tool accepts a private key, seed phrase or signer. The Caelara key is only ever printed masked.
Trial key on first use
The first time you run init, or the first time the server handles a tool call without a key, it sets up a trial key for this installation.
- What is sent: only a SHA-256 hash of
caelara-install-v1|<hostname>|<username>|<home directory>. The raw hostname, username and path never leave your machine. The same installation always gets the same trial back; a different user, home directory or CI runner gets its own. - Where it is kept:
~/.caelaralabs/credentials.json, readable by you only (mode 0600 on macOS and Linux; on Windows the file sits in your user profile). It is never written into a project folder or into your MCP client config. - Order of precedence:
CAELARA_KEYin the environment, then the saved credentials, then a trial key, then no key. - Opt out: set
CAELARA_NO_AUTO_TRIAL=1. Nothing is requested during the MCP handshake.
Test
node --test test/*.test.mjs
npx -y @caelaralabs/shield-mcp --helpLicense
MIT. Powered by Caelara Labs · https://caelaralabs.com · [email protected]
