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

OpenClaw Optimizer v1.18.0 released with OpenClaw v2026.3.7 alignment
OpenClaw Optimizer skill v1.18.0 is now aligned with OpenClaw v2026.3.7, adding support for new AI providers including Google Gemini 3.1 Flash-Lite and OpenAI gpt-5.4, plus new CLI commands like /session idle and /usage cost.

ClaudeMeter: Open-Source macOS Menu Bar App for Real-Time Claude Usage Tracking
ClaudeMeter is a free, open-source macOS menu bar app for Claude Max subscribers that displays session and weekly usage percentages, reset timers, and pace indicators without interrupting workflow. The entire app was built using Claude (Claude Code/Opus) for Swift code, Supabase backend, and Edge Functions.

Claude Token Counter Updated with Model Comparison Feature
Simon Willison's Claude Token Counter tool now supports comparing token counts across different Claude models. The update reveals Opus 4.7 uses 1.0–1.35× more tokens than Opus 4.6 due to an updated tokenizer, potentially increasing costs by around 40% despite identical pricing.

InsForge: Open-Source Backend Platform for AI Coding Agents
InsForge is an open-source backend platform (Apache 2.0) that provides AI coding agents with managed database, auth, storage, compute, hosting, and AI gateway, controllable via CLI or MCP.