Skip to content

Devleaps/agent-policies-gemini-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

agent-policies-gemini-cli

Policies allow your rules, often in natural language, to be expressed as policies; code. The policies are strict guardrails an AI Agent cannot bypass or disregard. Policies allow you to automate decisionmaking as well as guidance for AI Agents, letting them self-correct without interruption.

This repository contains only the Gemini CLI client. For the server reference implementation, see agent-policies-server.

Installation

Install the extension and register hooks:

gemini extensions install https://github.com/Devleaps/agent-policies-gemini-cli
node ~/.gemini/extensions/agent-policies/scripts/hooks-add.js

Remove hooks and uninstall:

node ~/.gemini/extensions/agent-policies/scripts/hooks-remove.js
gemini extensions uninstall agent-policies

Architecture

graph TB
    subgraph "Developer Machine"
        Editor[Gemini CLI]
        Client[agent-policies-gemini-cli]
    end

    subgraph "Policy Server"
        Server[HTTP API]
        Policies[Your policies<br/>kubectl, terraform, git, python, etc.]
    end

    Editor -->|BeforeTool / AfterTool| Client
    Client --> Server
    Server -->|Events| Policies
    Policies -->|Decision and Guidance| Server
    Server --> Client
    Client -->|Decision and Guidance| Editor
Loading

Configuration

~/.agent-policies/config.json:

{
  // Policy server endpoint. Default: "https://agent-policies.devleaps.nl"
  "server_url": "http://localhost:8338",

  // Policy bundles to activate. Default: ["universal"]
  "bundles": ["universal", "python", "git"],

  // What to do when the server returns no decision: "allow", "ask", "deny". Default: "ask"
  "default_policy_behavior": "ask"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors