@microsoft/agent-governance-claude-code
v4.0.0
Published
Public Preview — Claude Code governance plugin for Agent Governance Toolkit developer protection policies
Readme
AGT Claude Code Plugin
This package is the production package surface for Agent Governance Toolkit on Claude Code.
It ships a Claude Code plugin that uses:
- Claude hooks for deterministic session, prompt, and pre-tool governance
- a bundled MCP server for operator-facing AGT inspection tools
- the AGT TypeScript SDK for policy evaluation, prompt defense, and MCP threat scanning
What this package is
- a first-party Claude Code plugin package
- an experimental parity layer for the existing Copilot CLI governance work
- a publishable npm package that can also be loaded locally with Claude Code
What this package is not
- a Copilot-style in-process extension
- a universal governance layer for every Claude surface
- a guarantee of full Copilot CLI feature parity
Current scope
This initial package enforces:
SessionStartgovernance context injectionUserPromptSubmitprompt inspection and fail-closed blockingPreToolUsetool-call inspection with allow, deny, or ask behavior
It also exposes two MCP tools:
agt_policy_statusagt_policy_check_text
Important parity gaps
- Claude slash commands are markdown-driven, so
/agt-governance:agt-statusand/agt-governance:agt-checkare thin wrappers around MCP tools rather than deterministic code handlers. PostToolUsein Claude cannot reliably redact tool output after the tool has already executed, so this package does not claim Copilot-style output suppression parity.- Hook execution is out-of-process. The package keeps enforcement in command hooks so policy errors can fail closed.
Local development
Run these commands from the repository root so the relative plugin path resolves correctly.
Install dependencies:
cd agent-governance-claude-code
npm installLoad the plugin directly:
claude --plugin-dir .\agent-governance-claude-codeclaude --plugin-dir "$(pwd)/agent-governance-claude-code"Inspect the active policy and command wiring:
/agt-governance:agt-status
/agt-governance:agt-check suspicious text to inspectReload after edits:
/reload-pluginsCommands
The package provides two Claude commands:
/agt-governance:agt-status/agt-governance:agt-check
Example walkthrough
For a runnable repo-local walkthrough with a sample policy override, expected prompts, and cleanup notes, see:
Policy loading
The package loads policy in this order:
AGT_CLAUDE_POLICY_PATH%USERPROFILE%\.claude\agt\policy.json~/.claude/agt/policy.json- bundled
config/default-policy.json
Audit entries are written to:
- Windows:
%USERPROFILE%\.claude\agt\audit-log.json - macOS/Linux:
~/.claude/agt/audit-log.json
Override with AGT_CLAUDE_AUDIT_PATH.
Validation
cd agent-governance-claude-code
npm run check
npm test