Metadata-Version: 2.5
Name: agent-tessera
Version: 0.8.0
Summary: Identity, permissions, and governance for AI agents, whatever LLM they call.
Project-URL: Homepage, https://github.com/agent-tessera/agent-tessera
Project-URL: Documentation, https://github.com/agent-tessera/agent-tessera/tree/main/docs
Project-URL: Repository, https://github.com/agent-tessera/agent-tessera
Project-URL: Issues, https://github.com/agent-tessera/agent-tessera/issues
Project-URL: Changelog, https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md
Author: Agent Tessera contributors
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai-agents,governance,guardrails,identity,llm,policy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.7
Requires-Dist: pyjwt[crypto]<3,>=2.9
Requires-Dist: pyyaml>=6.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: bedrock
Requires-Dist: boto3>=1.35; extra == 'bedrock'
Provides-Extra: crewai
Requires-Dist: crewai>=0.80; extra == 'crewai'
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0; extra == 'gemini'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Provides-Extra: litellm
Requires-Dist: litellm>=1.50; extra == 'litellm'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Provides-Extra: openai
Requires-Dist: openai>=1.50; extra == 'openai'
Provides-Extra: openai-agents
Requires-Dist: openai-agents>=0.2; extra == 'openai-agents'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.27; extra == 'otel'
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.27; extra == 'otel'
Description-Content-Type: text/markdown

# agent-tessera

Default-deny permissions and a tamper-evident audit log for AI agents,
whatever LLM they call.

Write what an agent may do in a short YAML file. Agent Tessera checks every
model call, tool call, and agent-to-agent call against it, in your process,
with no network round trip, and writes each decision to a hash-chained audit
log you can verify.

```bash
pip install agent-tessera
```

Python 3.11 or newer. No server and no API key needed.

## Quickstart

Save a policy as `policy.yaml`. Anything it does not allow is denied:

```yaml
apiVersion: tessera/v1
kind: AgentPolicy
metadata:
  agent: demo
spec:
  tools:
    allow: ["files.read"]
```

Save an agent as `agent.py`:

```python
from pathlib import Path

from agent_tessera import Denied, Tessera

tessera = Tessera("demo", policy="policy.yaml")


@tessera.tool("files.read")
def read_file(path: str) -> str:
    return Path(path).read_text(encoding="utf-8")


@tessera.tool("shell.run")
def run_shell(command: str) -> str:
    raise RuntimeError("never reached")


with tessera.task():
    print(read_file("policy.yaml").splitlines()[0])
    try:
        run_shell("rm -rf /")
    except Denied as err:
        print("blocked:", err)

tessera.close()
```

Run it and verify the audit log:

```bash
python agent.py
tessera audit verify .tessera/audit.jsonl
```

```text
apiVersion: tessera/v1
blocked: deny tool 'shell.run': not_granted
OK: 5 events
```

The denied function never ran. Edit any event in `.tessera/audit.jsonl` and
verification fails.

To govern an LLM client instead of a function, wrap it:

```python
from openai import OpenAI

client = tessera.wrap(OpenAI())  # needs: pip install "agent-tessera[openai]"
```

## Extras

The base install depends on `httpx`, `pydantic`, `pyjwt`, and `pyyaml` only.
Provider and framework support are extras: `openai`, `anthropic`, `bedrock`,
`gemini`, `litellm`, `otel`, `langchain`, `mcp`, `openai-agents`, and
`crewai`. For example:

```bash
pip install "agent-tessera[anthropic,otel]"
```

## The `tessera` command

`tessera policy validate` and `tessera policy check` load a policy and
evaluate one action. `tessera audit verify` checks an audit log. With the
control plane (`pip install agent-tessera-server`), `tessera server dev` starts
a local server and web console.

## What it does not do

It enforces policy on the calls you route through it, inside your process. It
does not sandbox the process or defend against hostile code running in it.
Read the
[threat model](https://github.com/agent-tessera/agent-tessera/blob/main/docs/threat-model.md)
before relying on it.

## Links

- [Source and full README](https://github.com/agent-tessera/agent-tessera)
- [Documentation](https://github.com/agent-tessera/agent-tessera/tree/main/docs)
- [Policy reference](https://github.com/agent-tessera/agent-tessera/blob/main/docs/policies.md)
- [Examples](https://github.com/agent-tessera/agent-tessera/tree/main/examples)
- [Changelog](https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md)

Apache 2.0.
