Tool Permission System Design
simbajigege/book2skills
Guides designing a layered permission pipeline for agent tools that decides which calls are allowed, need confirmation or are denied, with scopes and hooks.
Guide for creating a new policy engine under openbias/policy/engines/
$ npx skills add open-bias/open-bias --skill new-policy-engine -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install open-bias/open-bias new-policy-engine --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/new-policy-engine .claude/skills/new-policy-engine && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .claude/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engineType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add open-bias/open-bias --skill new-policy-engine -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install open-bias/open-bias new-policy-engine --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/new-policy-engine .agents/skills/new-policy-engine && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .agents/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add open-bias/open-bias --skill new-policy-engine -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install open-bias/open-bias new-policy-engine --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/new-policy-engine .cursor/skills/new-policy-engine && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .cursor/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/open-bias/open-bias.git --path .claude/skills/new-policy-engine--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add open-bias/open-bias --skill new-policy-engine -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install open-bias/open-bias new-policy-engine --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/new-policy-engine .gemini/skills/new-policy-engine && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .gemini/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install open-bias/open-bias new-policy-engineInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add open-bias/open-bias --skill new-policy-engine -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/new-policy-engine .github/skills/new-policy-engine && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .github/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add open-bias/open-bias --skill new-policy-engine -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install open-bias/open-bias new-policy-engine --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/open-bias/open-bias.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/new-policy-engine .opencode/skills/new-policy-engine && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "new-policy-engine" agent skill from https://github.com/open-bias/open-bias/tree/main/.claude/skills/new-policy-engine into .opencode/skills/new-policy-engine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "new-policy-engine", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
new-policy-engineGuide for creating a new policy engine under openbias/policy/engines/
New Policy Engine is an agent skill from open-bias/open-bias. Guide for creating a new policy engine under openbias/policy/engines/
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Authorization and RBAC and LLM guardrails. The repository describes itself as: Open Source policy enforcement proxy: Make your agents follow rules. The licence is Apache-2.0.
7 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit c680075. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python and yaml).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
New Policy Engine loads about 1.3k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 265 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from open-bias/open-bias at commit c680075, republished under its Apache-2.0 licence (© open-bias). 265 words, ~1,301 tokens.
.claude/skills/new-policy-engine/SKILL.md (or your agent's skills folder).PolicyEngine — Use when each request/response is evaluated independently against policy. No state transitions between turns. Examples: Judge (compiled-rule evaluation), NeMo (guardrails).StatefulPolicyEngine (from openbias.policy.engines.stateful) — Use when you need to track state transitions across turns (e.g., FSM workflows). Adds classify_response, get_current_state, get_state_history, get_valid_next_states.If you're unsure, start with PolicyEngine. You can always extend later.
Create the engine package
openbias/policy/engines/<name>/
├── __init__.py # Export engine class
├── engine.py # Engine implementation
└── compiler.py # (Optional) NL-to-config compilerImplement the engine class in engine.py
from typing import Any, Dict, Optional
from openbias.policy.protocols import (
EvaluationResult,
EvaluationStatus,
ViolationRecord,
PolicyEngine,
require_initialized,
)
from openbias.policy.registry import register_engine
@register_engine("<name>")
class MyPolicyEngine(PolicyEngine):
def __init__(self) -> None:
self._initialized = False
self._config: Dict[str, Any] = {}
self._session_data: Dict[str, Dict[str, Any]] = {}
@property
def name(self) -> str:
return "<name>:<variant>"
@property
def engine_type(self) -> str:
return "<name>"
async def initialize(self, config: Dict[str, Any]) -> None:
self._config = config
# Setup resources, load models, etc.
self._initialized = True # CRITICAL: must set this
@require_initialized
async def evaluate_request(
self,
session_id: str,
request_data: Dict[str, Any],
context: Optional[Dict[str, Any]] = None,
) -> EvaluationResult:
# Return EvaluationResult(status=EvaluationStatus.ALLOW)
...
@require_initialized
async def evaluate_response(
self,
session_id: str,
response_data: Any,
request_data: Dict[str, Any],
context: Optional[Dict[str, Any]] = None,
) -> EvaluationResult:
# This is where most evaluation logic lives
...
async def get_session_state(self, session_id: str) -> Optional[Dict[str, Any]]:
return self._session_data.get(session_id)
async def reset_session(self, session_id: str) -> None:
self._session_data.pop(session_id, None)
async def shutdown(self) -> None:
self._session_data.clear()
self._initialized = FalseExport in the engine's __init__.py
from openbias.policy.engines.<name>.engine import MyPolicyEngine
__all__ = ["MyPolicyEngine"]Register the import in openbias/policy/engines/__init__.py
Add a line alongside existing imports:
from openbias.policy.engines import fsm, nemo, llm, judge, <name>(Optional) Create a compiler — see openbias/policy/compiler/ for the PolicyCompiler ABC and LLMPolicyCompiler base class. Use @register_compiler("<name>"). Wire it via get_compiler() on your engine.
Add a config example for openbias.yaml
engine: <name>
<name>:
some_option: valueWrite tests in tests/policy/engines/<name>/
At minimum: initialization, evaluate_request with ALLOW result, evaluate_response with INTERVENE/BLOCK result, session reset.
self._initialized = True in initialize() — the @require_initialized decorator will reject all evaluate calls.async. Use await for I/O. Never block the event loop.reset_session properly. The interceptor calls this for TTL-expired sessions.request_data — Always work on copies. The interceptor may retry with the original.EvaluationResult — Always return EvaluationResult(status=..., violations=[...]).| File | What to look at |
|---|---|
openbias/policy/protocols.py | PolicyEngine ABC, EvaluationResult, EvaluationStatus, ViolationRecord |
openbias/policy/engines/stateful.py | StatefulPolicyEngine ABC, StateClassificationResult dataclass |
openbias/policy/registry.py | @register_engine decorator, PolicyEngineRegistry |
openbias/policy/engines/__init__.py | Where to add your import |
openbias/policy/engines/fsm/ | Stateful engine example (smallest engine at ~340 lines) |
openbias/policy/engines/nemo/ | Stateless engine wrapping an external library |
openbias/policy/engines/judge/ | Judge engine example with LLM calls and compiled-rule evaluation |
© open-bias, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/new-policy-engine of open-bias/open-bias.
Open the folder on GitHubat commit c680075
New Policy Engine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| New Policy Engine this skillopen-bias/open-bias | 143 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Tool Permission System Designsimbajigege/book2skills | 183 | — | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| Tenuo Agent Authorizationtenuo-ai/tenuo | 103 | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Phoenix Authorization Patternsj-morgan6/elixir-phoenix-guide | 167 | — | ~2.1k | Automated safety check: Pass | MIT | |
| Aliyun Green Moderationcinience/alicloud-skills | 397 | — | ~728 | Automated safety check: Pass | MIT | |
| Walletsaustintgriffith/ethskills | 295 | — | ~1.9k | Automated safety check: Notes | None |
simbajigege/book2skills
Guides designing a layered permission pipeline for agent tools that decides which calls are allowed, need confirmation or are denied, with scopes and hooks.
tenuo-ai/tenuo
Add or retrofit Tenuo authorization for AI-agent tools and effects.
j-morgan6/elixir-phoenix-guide
A skill your agent uses when deciding who may do what — ownership checks, policy modules, scoped queries, role-based access in LiveViews and controllers.
cinience/alicloud-skills
A skill your agent uses when managing Alibaba Cloud Content Moderation (Green) via OpenAPI/SDK, including the user needs content moderation resource and policy operations, including…
austintgriffith/ethskills
How to create, manage, and use Ethereum wallets. An agent skill from austintgriffith/ethskills.
vinayaklatthe/microsoft-security-skills
Guidance for Azure Policy — enforcing and auditing governance and security guardrails at scale across Azure with definitions, initiatives, assignments, and remediation tasks.
open-bias/open-bias
Guide for writing eval conversation JSONs and running them through policy engines
Categories
Guide for creating a new policy engine under openbias/policy/engines/. New Policy Engine is an agent skill from open-bias/open-bias.
New Policy Engine fits situations like: tasks that involve Authorization and RBAC; tasks that involve LLM guardrails.
Run `npx skills add open-bias/open-bias --skill new-policy-engine -a claude-code`. Or copy the skill folder (.claude/skills/new-policy-engine in open-bias/open-bias) into .claude/skills/new-policy-engine in your project. Claude Code loads it when a task matches its description.
Run `npx skills add open-bias/open-bias --skill new-policy-engine -a codex`. Or copy the skill folder (.claude/skills/new-policy-engine in open-bias/open-bias) into .agents/skills/new-policy-engine in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add open-bias/open-bias --skill new-policy-engine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-policy-engine, .gemini/skills/new-policy-engine, .github/skills/new-policy-engine and .opencode/skills/new-policy-engine in your project.
SKILL.md names no scripts, command-line tools or credentials: New Policy Engine is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
New Policy Engine is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with New Policy Engine: Tool Permission System Design (simbajigege/book2skills, 183 stars), Tenuo Agent Authorization (tenuo-ai/tenuo, 103 stars), Phoenix Authorization Patterns (j-morgan6/elixir-phoenix-guide, 167 stars) and Aliyun Green Moderation (cinience/alicloud-skills, 397 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
open-bias (a GitHub organization) maintains it in open-bias/open-bias, which has 143 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.
Source: open-bias/open-bias on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.