Logo vun Capability Authorization Gate

Capability Authorization Gate

Communautéit
AnthonyAlcaraz
capability-authorization-gate

Runtime authorization gate built on the Ch3 Capability Model Pattern — a self-aware agent represents its own capabilities, required resources/grants, authorization level, and quantitative limits as queryable structure, then checks at PLANNING time whether it may perform an action BEFORE attempting it. Returns allow, escalate (the agent itself cannot but a higher authority could — route appropriately), or deny (the capability is undeclared). The canonical case: a support agent with a $500 refund limit escalates a $600 request. Use when an agent must decide can-I-do-this before acting, when modeling agent operational boundaries, or when building the queryable authority layer that gates tool use (Ch6). NOT for human RBAC/IAM policy enforcement (use the platform's IAM), NOT for validating that a capability NODE is well-formed (use schema-pattern-selector's capability_model validation), NOT a replacement for actual credential checks at the API boundary (this is the planning-time gate).

Iwwersiicht

EditeurAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nummcapability-authorization-gate
Stären
29
Forks
9
Matgeliwwert Fichieren
3
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum AnthonyAlcaraz op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Capability Authorization Gate an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/knowledge-representation/capability-authorization-gate
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/knowledge-representation/capability-authorization-gate .claude/skills/capability-authorization-gate
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Capability Authorization Gate an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Capability Authorization Gate automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Capability Authorization Gate net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Capability Authorization Gate

Overview

Self-aware agents must understand their own capabilities and limitations. The Capability Model Pattern (Ch3, Example 3-5) makes operational parameters explicit, queryable structure: each capability declares what it requires, an authorization-level, and an optional quantitative limit. During planning the agent determines whether it has the access, authorization, and headroom to fulfill a request before attempting it — and routes/escalates when it does not.

The chapter's worked example: a Customer-Support-Agent can Answer-Product-Question (Public, needs only Product-Knowledge) but Process-Refund requires Supervisor authorization, Financial-System-Access, and caps at 500 USD. A 600-USD refund must be recognized as exceeding authority and routed appropriately — "creating more reliable, trustworthy automation with appropriate human oversight" — instead of attempting a prohibited action.

The gate returns three decisions:

  • allow — capability declared, granted auth level >= required, all required resources present, amount (if any) within limit.
  • escalate — the agent itself cannot, but a higher authority could: authorization too low, a required grant missing, or the amount over the limit. This is the "route appropriately" path.
  • deny — the capability is undeclared. The agent has no such ability at all.

The DevOps manifestation (anchored in fictional AWS account 123456789012): capabilities like read_metrics (Public), query_logs (User), restart_instance (Supervisor + ec2:write), and scale_autoscaling_group (Supervisor, limit 10 instances) become the queryable authority model that gates tool orchestration in Ch6. A User-level latency investigator can read metrics and logs but escalates a restart or an over-limit scale.

When to Use

  • An agent must decide "can I do this?" before invoking a tool or taking an action
  • Modeling agent operational boundaries (authority, required grants, limits)
  • Building the queryable authority layer that gates tool orchestration (Ch6)
  • Implementing graceful escalation/routing instead of attempting prohibited actions

Phrases: "capability model", "can the agent do X", "authorization level", "operational limit", "escalate", "refund limit", "agent authority", "queryable authority", "tool authorization gate".

When NOT to Use

  • Human RBAC/IAM enforcement. This is the agent's planning-time self-check, not your platform's identity policy. Real credential checks still happen at the API boundary.
  • Validating the capability NODE shape. Use schema-pattern-selector (capability_model validation) to confirm a capability declaration is well-formed; this skill consumes well-formed declarations and decides.
  • As the only security control. The gate prevents the agent from ATTEMPTING an over-authority action; it does not replace server-side authorization. Defense in depth: gate at planning AND enforce at the boundary.

Process

StepInputActionOutputVerification
1agent spec JSON (id, granted_level, granted_resources, capabilities[])lib.agent_from_spec(spec)Agent with Capability mapunknown auth level raises at construction
2agent + capability type + optional amountlib.authorize(agent, cap, amount){decision, capability, reasons, required_level, granted_level}allow only if level met, resources present, within limit
3over-limit amountlib.authorize(agent, "Process-Refund", 600)decision == "escalate", reason cites limit$600 vs $500 limit escalates, never allows
4undeclared capabilitylib.authorize(agent, "X")decision == "deny"deny is distinct from escalate
5agent + capability + amountlib.can_do(agent, cap, amount)boolTrue only when decision is allow

Rationalizations

Agent rationalizationDocumented rebuttal
"I'll just try the refund and let it fail downstream if it's too big."Attempting a prohibited action is the failure mode the pattern exists to prevent. The chapter: recognize $600 exceeds the $500 limit and route it — do not attempt. Trying-and-failing leaks intent, may partially execute, and erodes the trustworthy-automation guarantee.
"Escalate and deny are the same — both mean 'no'."They are different and the difference is actionable. Deny = the agent has no such capability at all (dead end). Escalate = a higher authority CAN do it (route to a supervisor / human). Collapsing them loses the routing decision the pattern enables.
"The agent is Supervisor now, so any refund amount is fine."Authorization level and quantitative limit are independent checks. Even a Supervisor escalates a $600 refund if the capability's limit is $500. Raising the actor's level does not raise the capability's limit.
"Required resources are implicit — skip the grants check."The chapter ties capabilities to concrete requirements (Financial-System-Access; in DevOps, ec2:write). A capability the agent is authorized for but lacks the resource grant for must still escalate. Skipping the grant check produces a confident "allow" the downstream API will reject.
"This duplicates IAM, just rely on AWS IAM."This is the planning-time self-check that lets the agent decide BEFORE making the call (and route gracefully). IAM enforces at the boundary. They compose — defense in depth — they do not substitute.

Red Flags

  • Gate returns allow for an action the downstream API then rejects. The agent's granted_resources/level are out of sync with reality — refresh the capability model from the actual authority source.
  • Everything escalates. The agent's granted_level/resources are under-provisioned, or the capability declarations over-require. Re-check the spec; constant escalation defeats automation.
  • A capability has a limit but callers never pass an amount. The gate warns; an unchecked limit is a silent over-authority risk. Always pass the amount for limited capabilities.
  • deny for a capability the agent clearly should have. The capability is missing from the declaration — add it, do not work around the gate.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report 10/10:
    • Public capability with resources -> allow
    • $600 refund over $500 limit -> escalate (reason cites the limit)
    • undeclared capability -> deny (distinct from escalate)
    • Supervisor + resources allows $400 but still escalates $600
    • DevOps: User escalates restart_instance and over-limit scale, allows read_metrics
    • unknown authorization level raises at construction
  2. Run the scenarios. python cli.py scenario support-refund and python cli.py scenario devops-latency print allow/escalate/deny across the chapter's cases (DevOps anchored in AWS account 123456789012).
  3. Verify CLI help. python cli.py --help exits 0 and prints this SKILL.md description (so any harness can discover the skill from --help).

Security Posture

  • Prompt injection. The agent spec JSON is untrusted configuration: an adversarial spec that inflates granted_level, pads granted_resources, or raises a capability limit turns the gate into a rubber stamp. The gate never executes spec content - load specs only from the real authority source, not from agent- or user-supplied text.
  • Data exfiltration. No network calls, no file writes. Capability declarations may reveal internal authority topology; decisions go to stdout and the caller owns downstream piping.
  • Privilege escalation. The gate is itself an anti-escalation control, but it is planning-time and advisory: an "allow" grants no credential, and a bypassed gate must still hit server-side IAM at the API boundary. Defense in depth - never let this replace boundary enforcement.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch3 — Knowledge Representation, section "Capability Model Pattern" (Example 3-5: the Customer-Support-Agent with a $500 refund limit that escalates a $600 request). The DevOps capability-as-queryable-authority manifestation is from "Applying schema patterns to infrastructure", feeding the tool-orchestration authority model in Ch6.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Capability Authorization Gate?

Runtime authorization gate built on the Ch3 Capability Model Pattern — a self-aware agent represents its own capabilities, required resources/grants, authorization level, and quantitative limits as queryable structure, then checks at PLANNING time whether it may perform an action BEFORE attempting it. Returns allow, escalate (the agent itself cannot but a higher authority could — route appropriately), or deny (the capability is undeclared). The canonical case: a support agent with a $500 refund limit escalates a $600 request. Use when an agent must decide can-I-do-this before acting, when m...

Firwat Capability Authorization Gate op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Capability Authorization Gate besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Capability Authorization Gate an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/knowledge-representation/capability-authorization-gate an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Capability Authorization Gate benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Capability Authorization Gate benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Capability Authorization Gate domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Capability Authorization Gate gratis?

Jo. De Skill gëtt vum AnthonyAlcaraz ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇