Metadata-Version: 2.4
Name: agent-audit-cli
Version: 0.1.0
Summary: Fail-closed audit CLI for AI agent tool calls: adjudicate one request, verify the hash-chained trail (WorkBuddy Connector edition).
Author-email: agent-audit-cli maintainers <2307788504@qq.com>
License-Expression: MIT
Keywords: agent,audit,cli,fail-closed,workbuddy,connector
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: agent-call-audit>=0.1.1

# agent-audit-cli

Fail-closed audit CLI for AI agent tool calls — adjudicate one request, verify the hash-chained trail.

A thin command-line wrapper over the `agent-call-audit` engine (`audit_guard`), designed as a **WorkBuddy Connector (CLI + Skill scheme)**: an AI assistant can adjudicate agent tool calls against a rule set and verify the tamper-evident trail, using only this command.

## Install

```bash
pip install agent-audit-cli
```

## Commands

| Command | Purpose | Exit |
|:--------|:--------|:-----|
| `agent-audit check` | Adjudicate one tool-call JSON request, print verdict | 0 = allowed, 2 = denied, 3 = error |
| `agent-audit verify` | Verify a hash-chained trail file | 0 = ok, 2 = fail |
| `agent-audit status` | Self-check (rules load, engine import) | 0 = ok, 3 = error |

### check

```bash
agent-audit check --request-json '{"caller_id":"agent-alpha","target_capability":"data.lookup","action_type":"read","data_class":"internal","request_hash":"...","nonce":"..."}'
agent-audit check --request-file req.json --rules rules.json --trail trail.jsonl
```

Human verdicts exit 0 — the caller must resolve them via a human channel.

### verify

```bash
agent-audit verify --trail trail.jsonl
```

### status

```bash
agent-audit status [--rules rules.json]
```

## Exit codes

- `0` — success / ALLOWED / human verdict
- `2` — denied / FAIL (trail corrupt)
- `3` — error (bad usage, missing rule set, engine failure — fail-closed)

## Fail-closed guarantee

Any engine or rule-loading failure produces an error verdict and a non-zero exit code — the caller must treat it as **deny**, never silently allow.

## License

MIT
