Get your free
API key.
Connect your app to deny.sh’s hosted services with an API key, your account’s access credential.
Free. No card. 500 API calls/month.
Your API key authorises service requests. We store a hash, never the key itself. A dashboard password only unlocks account controls.
Encrypt + decoy
Free hosted encrypt/decrypt API. Creating a chosen decoy through the hosted API requires a paid plan. You can try chosen decoys in the free browser tool or run the local SDK. Compare entitlements.
Vault storage
Store client-side encrypted secrets in your vault. The separate encrypt tool creates real and decoy control files.
Decoy alerts
Register a decoy’s identifier for alerts when our monitored decryption service sees it. Availability depends on your plan.
Code libraries in 4 languages
Free code libraries for TypeScript, Python, Go and Rust. Local encryption needs no account.
What it looks like in practice
Create an API key, then follow the encrypt/decrypt quickstart. Both passwords are required together; choose the real or decoy control file when decrypting.
Open the quickstart ↗You're in.
Copy your key, as it will not be displayed again.
- Your API key is hidden when this page becomes hidden, for example when you switch tabs or minimise the browser, and is not shown again on this screen.
- The full API key is not stored. deny.sh stores its SHA-256 hash and last four characters.
- If you lose your key, sign in with your dashboard password and choose Rotate under API keys.
Connect your agent
Use your Free account’s API key with the OpenAI Agents SDK for JavaScript and TypeScript.
- The test key is made up
- No OpenAI key needed
- Node.js 22 or newer
-
Install the plug-in
Run this command in an empty folder.
npm install deny-sh-openai-agents @openai/agents zod -
Try a fake key
Save this script as test-decoy.mjs and run it with your API key in DENY_API_KEY. It prints
stopped: deny_decoy_leak.import { createDecoyWatch } from 'deny-sh-openai-agents'; const decoy = 'sk_live_DECOY_change_me_to_any_fake_value'; const watch = createDecoyWatch({ decoys: [{ label: 'my first decoy', value: decoy }], }); await watch.arm(); await watch .check(`The key is ${decoy}`, 'model_output') .catch((error) => console.log('stopped:', error.code));
export DENY_API_KEY=dk_your_key node test-decoy.mjs
Expected outputstopped: deny_decoy_leakSeeing something else?
Cannot find package 'deny-sh-openai-agents'- Run the install command in the folder containing your script.
An API key is required for decoy reporting or arming.- Set DENY_API_KEY in the same terminal window and run the script again.
deny.sh returned 401 while arming a decoy tripwire.- Set DENY_API_KEY to the key you copied from this screen and run the script again. If you did not save it, sign in and rotate it under API keys.
-
Check your test was recorded
Open Decoy alerts in your dashboard to see the armed decoy and the recorded leak.
-
Connect it to your agent
Attach a watch configured with the same decoy to your agent’s final answers and tool calls as shown below. A final answer containing the decoy is stopped, and a tool call with the decoy in its arguments is not executed.
import { Agent, tool } from '@openai/agents'; import { z } from 'zod'; import { createDecoyWatch, decoyWatchOutputGuardrail, decoyWatchToolInputGuardrail, } from 'deny-sh-openai-agents'; const decoy = 'sk_live_DECOY_change_me_to_any_fake_value'; const watch = createDecoyWatch({ decoys: [{ label: 'my first decoy', value: decoy }], }); const sendEmail = tool({ name: 'send_email', description: 'Send an email', parameters: z.object({ to: z.string(), body: z.string() }), inputGuardrails: [decoyWatchToolInputGuardrail(watch)], execute: async () => 'sent', }); const agent = new Agent({ name: 'Support agent', instructions: 'Help the customer.', tools: [sendEmail], outputGuardrails: [decoyWatchOutputGuardrail(watch)], });