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

@agenticcontrolplane/governance-anthropic

v0.1.0

Published

Agentic Control Plane adapter for Anthropic SDK and Claude Agent SDK. Govern every tool_use block from Claude.

Readme

@agenticcontrolplane/governance-anthropic

Agentic Control Plane adapter for the Anthropic SDK and Claude Agent SDK. Govern every tool_use block from Claude with PreToolUse / PostToolUse, audit log entries tagged by Skill/agent name, and full delegation chain attribution.

Install

npm install @agenticcontrolplane/governance @agenticcontrolplane/governance-anthropic @anthropic-ai/sdk

Two ways to use it

1. Wrap your tool handlers (withGovernance)

Drop-in replacement for your existing tool registry. Each call passes through ACP automatically.

import Anthropic from "@anthropic-ai/sdk";
import { GovernanceClient } from "@agenticcontrolplane/governance";
import { withGovernance } from "@agenticcontrolplane/governance-anthropic";

const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
const acp = new GovernanceClient({ apiKey: process.env.ACP_API_KEY! });

const myToolHandlers = {
  github_create_repo: async (input: { name: string }) => github.repos.create(input),
  slack_post:         async (input: { channel: string; text: string }) => slack.chat.postMessage(input),
};

// Each handler is now wrapped with PreToolUse + PostToolUse + audit logging.
// "pr-reviewer" appears as a distinct agent in your ACP dashboard.
const tools = withGovernance(myToolHandlers, acp, {
  agentName: "pr-reviewer",
  agentTier: "api",
});

// Drive your own Anthropic message loop, calling the wrapped handlers.
const result = await tools.github_create_repo({ name: "new-repo" });

2. Run the whole loop (runMessagesWithTools)

For when you want one call that drives the model + tool execution end-to-end with governance applied at every iteration.

import { runMessagesWithTools } from "@agenticcontrolplane/governance-anthropic";

const result = await runMessagesWithTools({
  client: anthropic,
  acp,
  agent: { agentName: "pr-reviewer", agentTier: "api" },
  model: "claude-sonnet-4-6",
  system: "You review pull requests. Use tools to gather data.",
  messages: [
    { role: "user", content: "Review https://github.com/acme/repo/pull/42" },
  ],
  tools: [
    { name: "github_create_repo", description: "Create a repo", input_schema: { type: "object" } },
    { name: "slack_post",         description: "Post to Slack", input_schema: { type: "object" } },
  ],
  toolHandlers: myToolHandlers,
  maxIterations: 20,
});

console.log(result.finalContent);   // assistant's final message
console.log(result.iterations);     // number of tool-use rounds
console.log(result.truncated);      // true if maxIterations was hit

When ACP denies a tool call, runMessagesWithTools surfaces the denial as a tool_result block with is_error: true so Claude can adapt — try a different approach, report partial results — instead of the whole run throwing mid-conversation.

What you get in the dashboard

  • Detected agents page (cloud.agenticcontrolplane.com/agents): each agentName you pass becomes a distinct row.
  • Activity log: every tool call is recorded with the agent name, identity, decision, latency, and any PII / prompt-injection findings.
  • Delegation chains: when one governed agent invokes another (via the SDK), the chain is reconstructed automatically — originSub → parent agent → child agent → tool call — visible on the Agent Monitor → Run Details panel.

Anthropic Agent SDK / Skills

The same pattern works for the higher-level Anthropic Agent SDK. Register each Skill as a distinct agentName and wrap its tool handlers with withGovernance. Sub-skill invocations register as delegation chain links.

const researcherTools = withGovernance(researchHandlers, acp, { agentName: "skill.researcher" });
const writerTools     = withGovernance(writerHandlers,     acp, { agentName: "skill.writer" });

Limitations

  • runMessagesWithTools doesn't stream by default. Streaming support is on the roadmap. For now, the loop accumulates the full response per turn.
  • Tool input/output is logged, not mutated. ACP surfaces redact decisions for the audit log; mutating the actual tool input before execution requires a deeper integration with the SDK's middleware.
  • Pre-release: 0.1.x is the initial release. API may evolve based on real usage feedback. Pin exact versions in production.

Related

License

MIT