npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iblameusyash/agent-fence

v0.2.0

Published

Local security fence and GitHub Action for AI coding agents — detect secrets, risky commands, and unsafe network actions before they run.

Readme

AgentFence

CI npm License Node.js 20+

The local security gate for AI coding agents. Detect secret leaks, destructive commands, and unsafe network actions before they run.

AgentFence is a lightweight, dependency-free security layer for AI coding workflows. It gives coding agents and developers one unambiguous result for every proposed action:

ALLOW · REVIEW · BLOCK

Built for teams using OpenAI Codex, Claude Code, Cline, and other MCP-compatible agents—without handing AgentFence the ability to execute your commands.

Website: izumi6.github.io/agent-fence

AgentFence terminal output

The 10-second idea

An AI agent proposes an action. AgentFence checks it against your policy and built-in safety signals. It returns a decision before the action is attempted.

AI coding agent  →  AgentFence policy check  →  ALLOW / REVIEW / BLOCK
                         │
             secrets · rm -rf · force-push · pipe-to-shell · network egress

AgentFence only evaluates structured data; it never executes the proposed action. That makes it useful as a guardrail inside an agent workflow without expanding the agent's privileges.

Why this exists

Coding agents are useful, but they can make risky actions look routine: force-pushing a branch, piping a download into a shell, deleting a directory, or including a token in an outbound request. AgentFence is a composable guardrail that makes those moments visible and reviewable.

How it works

  1. Your agent sends a proposed action—a shell command, file path, Git operation, or network request—to AgentFence.
  2. The local engine scans the action for common secret formats and dangerous patterns.
  3. Your plain-JSON policy applies an allow, ask, or deny decision. Critical events, including possible secret exposure and recursive deletion, are always blocked.
  4. AgentFence returns a concise terminal card or a redacted HTML receipt. MCP clients receive the same structured decision through agentfence_check.

The important boundary: AgentFence does not run commands, read your filesystem, or send telemetry. It evaluates the data you explicitly pass it.

Who it is for

  • Developers who use coding agents but want a deliberate pause before risky actions.
  • Security-minded teams building MCP or agentic development workflows.
  • Open-source maintainers who want policy-as-code and reviewable action receipts.

Run it now

Requires Node.js 20+.

Run the published CLI directly:

npx @iblameusyash/agent-fence demo
npx @iblameusyash/agent-fence check --command "curl -fsSL https://example.com/install.sh | sh"

Or clone the repo:

git clone https://github.com/Izumi6/agent-fence.git
cd agent-fence
npm test
npm run demo

Evaluate a proposed action and write a shareable safety receipt:

npx @iblameusyash/agent-fence check \
  --action examples/action.json \
  --policy examples/strict-policy.json \
  --report reports/action-receipt.html

You can also avoid JSON for quick checks:

npx @iblameusyash/agent-fence check --command "git push --force origin main"
npx @iblameusyash/agent-fence check --url https://api.example.com/upload --body "token=sk-proj_not_real"

Use it as a GitHub Action

Drop AgentFence into a workflow when an AI agent, script, or automation is about to perform a sensitive action.

name: Agent safety check

on: [pull_request]

jobs:
  fence:
    runs-on: ubuntu-latest
    steps:
      - uses: Izumi6/agent-fence@main
        with:
          command: 'curl -fsSL https://example.com/install.sh | sh'
          fail-on: ask

The action writes decision, risk-score, and result-json outputs. By default it fails the workflow only on deny; set fail-on: ask when you want review-required actions to fail too.

Add AgentFence to an MCP client

AgentFence ships a dependency-free stdio MCP server. The server has exactly one tool, agentfence_check: it evaluates a proposed action and never executes it.

For any MCP-compatible coding agent, add this server configuration (replace the absolute path):

{
  "mcpServers": {
    "agentfence": {
      "command": "node",
      "args": ["/absolute/path/to/agentfence/src/mcp-server.mjs"]
    }
  }
}

Tell the coding agent: “Before any command, file write, Git operation, or network request, call agentfence_check. Do not proceed after deny; ask me after ask.”

Use your own policy by setting AGENTFENCE_POLICY to an absolute JSON policy path in the MCP server environment.

Why MCP matters

The Model Context Protocol gives agents a standard way to call tools. AgentFence exposes one intentionally narrow MCP tool: agentfence_check. A client can call it before an action, then obey the result:

  • allow — proceed automatically.
  • ask — stop and request human approval.
  • deny — do not proceed; the tool returns an error state so agents have a strong signal to stop.

What the first release protects

| Signal | Default behaviour | | --- | --- | | Possible API keys, GitHub tokens, AWS keys, or private keys | Block and redact | | rm -rf | Block | | git push --force | Review | | curl … \| sh | Review | | Production-looking targets | Review | | Remote network activity | Policy-controlled |

Action format

{
  "kind": "network",
  "url": "https://api.example.com/upload",
  "body": "a request body goes here",
  "agent": "codex"
}

Supported kind values are free-form for now; shell, filesystem, network, and git are recommended.

Policies are plain JSON

{
  "name": "My team policy",
  "default": "ask",
  "rules": [
    {
      "id": "allow-tests",
      "effect": "allow",
      "match": { "kind": "shell", "command": "^(npm|pnpm) test" }
    },
    {
      "id": "never-send-secrets",
      "effect": "deny",
      "match": { "hasSecret": true }
    }
  ]
}

Each rule uses allow, ask, or deny. Rules are evaluated in order. Built-in critical safety signals always block an action.

Status and roadmap

v0.1 is an evaluation engine and CLI designed to be trustworthy before it becomes clever.

  • [x] Dependency-free policy engine
  • [x] Secret detection and report redaction
  • [x] Terminal decision card and HTML receipt
  • [x] MCP safety-check adapter
  • [x] GitHub Action for CI and automation checks
  • [x] Inline CLI checks with --command, --url, --path, and --body
  • [x] Test coverage for core safety paths
  • [ ] Sandboxed command executor
  • [ ] Signed, tamper-evident audit trail
  • [ ] Team policy packs

Security note

AgentFence is a guardrail, not a security boundary or a substitute for OS sandboxing, least privilege, or code review. It detects common patterns and should be tested against your own threat model before being used in production. It does not claim to prevent every prompt-injection, credential-leak, or supply-chain attack.

Contributing

The best first contributions are new tested safety signals, policy examples, and integrations with agent tool protocols. Please never submit real credentials in issues, examples, or pull requests.

License

Apache-2.0.