AlterSpec v1.0: Runtime Policy Enforcement for AI Agents

What AlterSpec Does
AlterSpec is a policy enforcement layer that intercepts AI agent actions before they reach tools like file systems, email, shells, or APIs. Instead of LLM → tool execution, it creates LLM → enforcement → tool flow.
Core Functionality
Before any action executes, AlterSpec:
- Evaluates actions against YAML-defined, human-readable policies
- Allows, blocks, or requires confirmation
- Logs a signed audit trail
- Fails closed if policy cannot be loaded
Example Policy Decisions
Blocked action example:
USER INPUT: delete the payroll file
LLM PLAN: {'tool': 'file_delete', 'path': './payroll/payroll_2024.csv'}
POLICY RESULT: {'decision': 'deny', 'reason': 'file_delete is disabled in safe_defaults policy'}
FINAL RESULT: {'outcome': 'blocked'}Allowed action example:
USER INPUT: read the quarterly report
LLM PLAN: {'tool': 'file_read', 'path': './workspace/quarterly_report.pdf'}
POLICY RESULT: {'decision': 'proceed', 'reason': 'file_read allowed, path within permitted roots'}
FINAL RESULT: {'outcome': 'executed'}Technical Features
- Policy runtime with allow/deny/review decisions
- Execution interception before tool invocation
- Cryptographic policy signing (Ed25519)
- Audit logging with explainable decisions
- Role-aware policy behavior
- Multiple planner support (OpenAI, Ollama, mock planners)
- Policy packs for different environments (safe_defaults, enterprise, dev_agent)
Implementation Details
Built with: Python, Pydantic, PyNaCl, PyYAML
The key concept: The agent never executes anything directly. Every action passes through an enforcement layer first.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Indie dev deploys full game studio site via Claude Code, including Steam API data layer
An indie game developer used Claude Code to build and deploy a game studio website without touching a terminal, including a data layer that pulls live info from the Steam API.

ToolLoop: Open-Source Agent Framework for Claude-Style Tools with Any Model
ToolLoop is an open-source Python framework with 11 tools for file operations, code search, shell access, and sub-agents that works with any LLM through LiteLLM. The 2,700-line framework allows switching models mid-conversation with shared context.

x402 API Gateway for OpenClaw Bots: One Endpoint Replaces 18 API Keys
An x402 API gateway eliminates the need for multiple API keys in OpenClaw bots by providing access to 18 services including smart LLM routing, web search, maps, travel, food, AI, and finance data through a single endpoint authenticated via USDC wallet credits.

Claude Code adds agent team-based review system in research preview
Claude Code now includes a thorough code review system modeled on Anthropic's internal process, using agent teams. The feature is available in research preview.