AlterSpec v1.0: Runtime Policy Enforcement for AI Agents

✍️ OpenClawRadar📅 Published: March 21, 2026🔗 Source
AlterSpec v1.0: Runtime Policy Enforcement for AI Agents
Ad

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'}
Ad

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

Ad

👀 See Also

LightMem: Lightweight Memory System for LLM Agents with 10×+ Gains and 100× Lower Cost
Tools

LightMem: Lightweight Memory System for LLM Agents with 10×+ Gains and 100× Lower Cost

LightMem is a modular memory system for LLM agents that achieves up to 10.9% accuracy improvement while reducing tokens by up to 117×, API calls by up to 159×, and runtime by over 12×. It's designed for scalable long-context reasoning across agent workflows.

OpenClawRadar
🦀
Tools

Building a Jarvis-Style AI with MCP and Open Models

A developer built a personal AI assistant using MCP and open models like Qwen3-Coder 480B, with autonomous file editing, persistent context, and hybrid local/cloud inference.

OpenClawRadar
AI Doomsday Toolbox v0.932 adds benchmarking, dataset creation, and agent workspace for Android local AI
Tools

AI Doomsday Toolbox v0.932 adds benchmarking, dataset creation, and agent workspace for Android local AI

AI Doomsday Toolbox v0.932 introduces benchmarking for local LLMs on Android devices, a dataset creator that converts text/PDF files to Alpaca JSON format, and an AI agent workspace with Termux integration. The update also includes subtitle burning with Whisper and built-in Ollama management tools.

OpenClawRadar
Security scanning skill for AI coding agents automatically checks deployments
Tools

Security scanning skill for AI coding agents automatically checks deployments

A developer created a skill file that enables AI coding agents to automatically scan their own deployments for security issues like exposed secrets, open ports, missing security headers, and leaked source code. The scan runs after every deploy and takes about 30 seconds.

OpenClawRadar