
PromptSpeak Governance
io.github.chrbaileyPublished by GitHub account chrbaileyv0.4.1Updated Oct 24, 2026
Pre-execution governance for AI agents. Validates tool calls before they execute.
Overview
A local governance layer that validates and blocks AI agent tool calls before they execute, with human approval holds, drift detection and audit logging.
- What you can do
- Validate governance frames and batch-check agent actions before execution, including dry runs of the full pipeline without executing the tool. Manage human-in-the-loop holds: list pending operations, approve with modified arguments, reject, and tune hold triggers and statistics. Control agent lifecycle: read agent state and system stats, halt or resume agents via a circuit breaker, reset state, and review drift history. Create, revoke and list parent-to-child delegations with constrained permissions. Configure governance rules, confidence thresholds and feature flags, and export or import configuration. Scan code for vulnerabilities and enforce block, hold, warn or allow policies, plus read,
- When to use it
- Use it when you run agents that call tools and want a deterministic check between intent and execution, especially for high-risk actions such as production deployments or financial transactions. It also suits regulated settings that need an audit trail of every attempted tool call and human approval for risky operations.
- Requirements
- Runs locally over stdio, typically launched with npx from the npm package or built from source. Needs Node.js 20 or newer; TypeScript 5.3+ only when building from source. No external services, accounts or API keys; governance data is stored locally in SQLite.
Installation
In SourceWeft
- Open PromptSpeak Governance in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
promptspeak-mcp-server
[CI] [npm version] [License: MIT] [Tests]
Pre-execution governance for AI agents. Blocks dangerous tool calls before they execute.
AI agents call tools (file writes, API requests, shell commands) with no validation layer between intent and execution. A prompt injection, hallucinated argument, or drifting goal can trigger irreversible actions. PromptSpeak intercepts every MCP tool call, validates it against deterministic rules, and blocks or holds risky operations for human approval — in 0.1ms, before anything executes.
When to use this
- You run AI agents that call tools (MCP servers, function calling, tool use) and need a governance layer between the agent and the tools.
- You need human-in-the-loop approval for high-risk operations (production deployments, financial transactions, legal filings).
- You want to detect behavioral drift — an agent gradually shifting away from its assigned task.
- You need an audit trail of every tool call an agent attempted, whether it was allowed or blocked.
- You operate in a regulated domain (legal, financial, healthcare) where agent actions must be deterministically constrained.
Install
Claude Code
Add to ~/.claude/settings.json (or project-level .claude/settings.json):
Restart Claude Code. All 56 governance tools are immediately available.
Claude Desktop
Add to claude_desktop_config.json:
As a library
From source
Usage examples
1. Validate a governance frame
Validate that a PromptSpeak frame is structurally and semantically correct before using it. Frames encode governance constraints as symbol sequences — mode first, then domain, action, and entity.
Invalid frames return actionable suggestions:
2. Hold queue workflow — human-in-the-loop approval
When an agent attempts a risky operation (high drift score, low confidence, security finding), the action is held for human review instead of executing. This is the full hold lifecycle: list, inspect, approve or reject.
Step 1: List pending holds
Step 2: Approve with modifications (or reject)
To reject instead:
3. Security scanning — catch vulnerabilities before execution
Scan code content for security issues before an agent writes it to disk. Critical findings block execution; high-severity findings are held for human review.
Use ps_security_gate instead of ps_security_scan to enforce the policy — it blocks on critical, holds high-severity for human review, and warns on medium:
How it works: 9-stage validation pipeline
Every tool call passes through this pipeline. If any stage fails, execution is blocked.
Stages 1-6 are pre-execution — the tool never runs if any check fails. Stages 8-9 are post-execution — they detect drift and can halt the agent for future calls.
Security scanning
When an agent writes code (write_file, edit_file, create_file, patch_file), the content is scanned against 10 detection patterns before execution. Severity determines enforcement:
What works (tested)
All claims below are backed by passing tests (104 tests across 5 test files):
- Pattern detection works. Each of the 10 patterns is tested for true positives AND false positives. Example:
api_key = "sk-1234567890abcdef"is caught;API_KEY = process.env.API_KEYis not. SQL injection catches\SELECT * FROM users WHERE id = ${id}`but not parameterized queries (db.query("SELECT * FROM users WHERE id = ?", [id])`). - Severity enforcement works. Critical findings block execution. High findings hold for review. Medium findings warn but allow. Tested end-to-end through the interceptor pipeline.
- Only write actions are scanned.
read_fileand other non-write actions pass through without scanning, even if their arguments contain vulnerable code. Tested. - Runtime configuration works. Patterns can be enabled/disabled and severity can be changed at runtime via
ps_security_config. A disabled pattern stops firing immediately. Changing a pattern from medium to critical makes it block instead of warn. Tested end-to-end. - Performance is fine. 100-line file scans complete in under 10ms. Tested.
- Multiple findings in one file work. A file with 6 different vulnerability types correctly classifies each into the right severity bucket. Tested.
What does NOT work yet
No hold queue integration for HIGH findings.FIXED. HIGH-severity security findings now create real holds in HoldManager viasecurity_findingHoldReason. They appear inps_hold_listand can be approved/rejected through the normal hold flow.- No auto-scan on
ps_execute. The security scan only triggers in the interceptor'sintercept()method for direct tool calls. If an agent usesps_execute(the governed execution path), the scan runs only if the inner tool is a write action AND the content is passed as a top-level arg. Nested argument structures may bypass scanning. Why:ps_executewraps tool calls in its own argument schema; the scanner checksproposedArgs.content, not deeply nested fields. - No file-path-based scanning. The scanner only examines content passed as arguments. It cannot scan files already on disk — it doesn't read from the filesystem. Why: The scanner is a pure function that takes a string. Adding filesystem access would change the security model.
- Patterns are regex-based, not AST-aware. The patterns use regular expressions, which means they can't understand code structure. A hardcoded secret inside a test fixture or a SQL injection in a comment will still trigger. False positive rates range from 25-70% depending on the pattern (documented per-pattern). Why: AST parsing would add dependencies and complexity. Regex is fast and good enough for a governance layer that holds for human review rather than silently blocking.
- Partial persistence. Holds and circuit breaker state now persist to SQLite (
data/governance.db) and survive server restarts. However, pattern configuration changes (enable/disable, severity changes viaps_security_config) are still in-memory only and reset on restart. Why: Pattern config is lightweight and rarely changed; full config persistence would need a separate config store.
MCP tools (56)
Core governance
Human-in-the-loop holds
Agent lifecycle
Delegation
Configuration
Symbol registry (entity tracking)
Security enforcement
Audit
Architecture
Performance
PromptSpeak adds governance to every tool call with sub-millisecond overhead. Benchmarked on Apple M2 Pro, Node.js 22, Vitest 4.0:
Latency (pre-execution check, 1000 iterations)
Throughput (concurrent operations)
Stress Tests
Suite
Requirements
- Node.js >= 20.0.0
- TypeScript 5.3+ (build from source)
- No external services required — SQLite for symbols and governance persistence
Related Projects
- deeptrend — Structured AI trend feed for autonomous agents. Curated from 14+ sources, synthesized via LLM Counsel, published every 6h as JSON Feed, RSS, and
llms.txt. Designed as a data source for agent monitoring pipelines.
Privacy Policy
https://promptspeak.admin-as-a-service.com/privacy
PromptSpeak does not collect personal data, has no telemetry, and stores all governance data locally in SQLite. See the full policy at the link above.
Data Processing Terms
https://promptspeak.admin-as-a-service.com/dpa
Standard data processing terms for platform integrations (e.g., Anthropic Connectors). PromptSpeak acts as a data processor; no sub-processors, no external data transmission.
License
MIT
Source: README.md at commit b9c3698
Tools
0Version history
1- v0.4.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts