DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to write a custom policy in JavaScript with Failproofai

Drop a file into .failproofai/policies/ and use allow, deny or instruct to shape agent behaviour.

Short answer: Install with npm install -g failproofai; then create a file in .failproofai/policies/; Return allow(), deny(message) or instruct(message) from your policy, as in the README example. All steps.

system. A policy is code that runs on every agent action; test it before relying on it.

Who it is forA developer with project-specific rules agents must follow.

The problemBuilt-in policies cannot know your repo's rules.

The outcomeA policy file that loads automatically and enforces your rule.

What you need first

  • Node.js with npm
  • A coding agent installed on the machine

Steps

  1. Install with npm install -g failproofai
  2. Create a file in .failproofai/policies/
  3. Return allow(), deny(message) or instruct(message) from your policy, as in the README example
  4. It loads automatically with no flags needed

Prompt for your agent

Using FailproofAI/failproofai, write a policy file in .failproofai/policies/ that denies <my risky command> with a clear message back to the agent, following the README's allow, deny and instruct API.

Caveat.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for FailproofAI/failproofai and "Write a custom policy in JavaScript"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer