Metadata-Version: 2.4
Name: agentsec
Version: 0.1.2
Summary: Security infrastructure for autonomous AI agents
Project-URL: Homepage, https://jtaylor.app
Project-URL: Documentation, https://agentsec-docs.vercel.app
Project-URL: Source, https://github.com/jtaylortech
Author-email: TaylorTech <hello@taylortech.dev>
License-Expression: Apache-2.0
Keywords: agents,ai,policy,security,telemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Provides-Extra: web
Requires-Dist: fastapi>=0.109; extra == 'web'
Requires-Dist: uvicorn>=0.27; extra == 'web'
Description-Content-Type: text/markdown

# AgentSec Python SDK

Security infrastructure for autonomous AI agents.

## Installation

```bash
pip install agentsec
```

## Quick Start

```python
from agentsec import AgentSecClient, policy

# Initialize client
client = AgentSecClient(agent_id="my-agent")

# Capture events manually
client.capture_prompt("What files are in /etc?")
client.capture_response("I'll list the files in /etc for you.")
client.capture_tool_call("list_directory", {"path": "/etc"})

# Or use the guard decorator for automatic capture + policy enforcement
@policy.guard
def execute_command(cmd: str) -> str:
    # Your implementation
    pass
```

## Policy Enforcement

```python
from agentsec import policy

# Load policies
policy.load("policies/")

# Policies are automatically enforced on guarded functions
@policy.guard
def read_file(path: str) -> str:
    with open(path) as f:
        return f.read()

# This will raise PermissionError if policy denies
read_file("/etc/passwd")
```

## Event Storage

Events are stored locally by default in `.agentsec/events/`. Each run creates a JSONL file.

```bash
# View events
cat .agentsec/events/*.jsonl | jq .
```

## Documentation

- [Event Schema](../../specs/event-schema.md)
- [Policy Specification](../../specs/policy-spec.md)
- [Getting Started](../../docs/getting-started.md)
