spec-ai-policy

Crates.iospec-ai-policy
lib.rsspec-ai-policy
version0.6.0-prerelease.12
created_at2025-11-24 23:49:33.038151+00
updated_at2026-01-04 05:03:35.21752+00
descriptionPolicy enforcement for spec-ai framework
homepage
repositoryhttps://github.com/geoffsee/spec-ai
max_upload_size
id1948923
size84,984
Geoff Seemueller (geoffsee)

documentation

README

spec-ai-policy

Policy enforcement and plugin system for the spec-ai framework.

Overview

This crate provides the policy engine that controls and restricts agent behavior through:

  • Policy Engine: Rule-based enforcement of agent capabilities and permissions
  • Plugin System: Extensible architecture for adding custom policies
  • Tool Restrictions: Control which tools agents can access
  • Agent Profiles: Different permission sets for different agent types

Features

The policy system enables:

  • Tool Allowlists: Explicitly allow specific tools per agent profile
  • Tool Denylists: Block specific tools from being used
  • Memory Limits: Control conversation history retention (memory_k)
  • Temperature Controls: Enforce temperature ranges per agent
  • Custom Policies: Extend with custom policy plugins

Agent Profiles

Define agents with different capabilities through policy configuration:

[agents.coder]
prompt = "You are a helpful coding assistant"
temperature = 0.3
allowed_tools = ["file_read", "file_write", "bash", "file_extract"]
memory_k = 10

[agents.researcher]
prompt = "You are a research assistant"
temperature = 0.8
denied_tools = ["bash", "file_write"]
memory_k = 20

The prompt_user tool is implicitly allowed unless explicitly denied, ensuring agents can always escalate to humans for clarification.

Dependencies

This crate depends on:

  • spec-ai-config - Configuration management

Usage

This is an internal crate used by:

  • spec-ai-core - For enforcing policies during agent execution
  • spec-ai-api - For API-level policy enforcement
  • spec-ai-cli - For CLI command restrictions

For end-user documentation, see the main spec-ai README.

Commit count: 0

cargo fmt