Metadata-Version: 2.4
Name: doberman-agent
Version: 0.1.0
Summary: Framework-agnostic middleware for approving or denying AI agent tool calls.
Author: Daksh Sharma, Gyan Talari
License: GPL-3.0-only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Doberman

Framework-agnostic middleware for approving or denying AI agent tool calls before they execute.

Doberman sits between an AI agent and its tools. Instead of allowing an agent to directly execute a function, the call is first routed through Doberman, which decides whether to allow or block it based on user-defined policies or an interactive approval prompt.

## Features

- Approve or deny tool calls before execution
- Allow once / deny once
- Always allow / always deny
- Persistent permission storage (`policies.json`)
- CLI for managing permissions
- Framework-agnostic design
- Zero external runtime dependencies

## Installation

```bash
pip install doberman-agent
```

Or install from source:

```bash
git clone https://github.com/DakshSharma304/Doberman.git
cd Doberman
pip install -e .
```

## Quick Example

```python
from doberman import doberman

tool_call = {
    "tool": "gmail",
    "args": {
        "action": "send_email",
        "to": "alice@example.com",
        "subject": "Hello",
        "body": "Hi!"
    }
}

tools = {
    "gmail": gmail_tool
}

result = doberman(tool_call, tools)
```

If the permission has never been seen before, Doberman asks the user:

```
Doberman permission request

Tool: gmail
Action: send_email

1 = Allow once
2 = Always allow
3 = Deny once
4 = Always deny
```

Future requests follow the stored policy automatically.

## Example

A complete Gemini + Gmail example is included:

```
examples/gemini_gmail_agent.py
```

Install the example dependencies:

```bash
pip install -r requirements-examples.txt
```

## CLI

List permissions:

```bash
doberman list
```

Allow permissions:

```bash
doberman allow gmail.send_email
```

Allow multiple permissions:

```bash
doberman allow gmail.send_email gmail.read_latest
```

Deny permissions:

```bash
doberman deny gmail.send_email
```

Remove permissions:

```bash
doberman remove gmail.send_email
```

## Project Structure

```
doberman/
    __init__.py
    cli.py
    doberman.py
    policy.py

examples/
    gemini_gmail_agent.py
```

## Roadmap

- Desktop approval dialog
- Wildcard policies (`gmail.*`)
- Conditional policies
- Framework adapters (OpenAI, Anthropic, LangGraph, CrewAI)
- Logging and auditing
- PyPI release

## Contributing

Issues and pull requests are welcome.

## License

Licensed under the GNU GPL v3.
