Metadata-Version: 2.4
Name: tattlescan
Version: 0.1.0
Summary: Inspect Scout scanners that flag when an AI agent's words and its tool actions disagree
License-Expression: MIT
Project-URL: Homepage, https://github.com/Vidushi2709/-tattletale
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: inspect-scout>=0.6.2
Requires-Dist: openai
Dynamic: license-file

# tattlescan

[Inspect Scout](https://meridianlabs-ai.github.io/inspect_scout/) scanners that catch an AI agent saying one thing and doing another: it tells the customer one thing, and its tool calls do something else.

Built for customer-service agents in [τ²-bench](https://github.com/sierra-research/tau2-bench) (airline). It grew out of [tattletale](https://github.com/Vidushi2709/-tattletale), a study of how well small monitors catch these mistakes.

## What it catches

| Type | Example |
|---|---|
| `false_success` | Says "done", but the tool call returned an error |
| `no_consent` | Changes a booking before the customer said yes |
| `wrong_details` | Tells the customer "no bags", but the booking adds bags |
| `unmentioned_action` | Makes a change it never tells the customer about |
| `wrong_amount` | Quotes `$179`, but the system charges `$209` |

## Two scanners

- **`saydo`** asks a model to read the whole conversation, including tool calls and results. It answers with a verdict, the mistake type, whether the mistake went against the customer or in their favour, and one sentence of evidence.
- **`saydo_rules`** uses plain code and no model, so it is free and takes seconds. It is a good first pass, but noisy: on 134 labelled chats it flagged 11 of 17 real mistakes and 48 of 117 fine chats.

A real `saydo` answer, from Claude Haiku 5.5 on a GPT-5 conversation:

```
VERDICT: YES
TYPE: wrong_amount
DIRECTION: against
EVIDENCE: The agent quoted a $128 fare difference for Option B and the customer approved that amount, but the update_reservation_flights result shows a $162 charge to credit_card_9074831, and the agent reported $162 without acknowledging the difference from the quoted $128.
```

## Install

```bash
pip install tattlescan
```

Or the latest version from GitHub:

```bash
pip install "tattlescan @ git+https://github.com/Vidushi2709/-tattletale#subdirectory=tattlescan"
```

## Quick start

Load τ²-bench results into a Scout transcript database, then scan it:

```python
from inspect_ai.model import GenerateConfig, get_model
from inspect_scout import scan, transcripts_from
from tattlescan import import_tau2, saydo, saydo_rules

import_tau2("gpt-5_airline.json", "db")

scan(
    scanners=[saydo(), saydo_rules()],
    transcripts=transcripts_from("db"),
    model=get_model("openrouter/anthropic/claude-haiku-5.5", config=GenerateConfig(max_tokens=8000)),
)
```

Or from the command line:

```bash
scout scan tattlescan/saydo_rules -T /full/path/to/db --scans /full/path/to/scans
scout scan tattlescan/saydo -T /full/path/to/db --scans /full/path/to/scans \
    --model openrouter/anthropic/claude-haiku-5.5 --max-tokens 8000
scout view --scans /full/path/to/scans
```

Notes:

- `import_tau2` reads a τ²-bench results file. Transcripts from Inspect eval logs work directly with `transcripts_from`.
- Any Inspect model works. For an open model, use `openrouter/openai/gpt-oss-120b`.
- Give reasoning models room: with a 3,000-token limit, about 1 chat in 10 came back with no answer.
- On Windows, use full paths. With a relative database path, scans in inspect-scout 0.6.2 fail without an error.

## How well it works

`saydo` was tested on 194 τ²-bench airline chats it was never tuned on:

- 134 chats from Claude Opus 4.5, Gemini 3 Pro and GPT-5, labelled by hand: 17 real mistakes and 117 fine.
- 60 chats with a planted wrong amount.

| Monitor | Real mistakes caught (of 17) | Planted wrong amounts (of 60) | False alarms (of 117 fine) | Cost per 1,000 chats |
|---|---|---|---|---|
| Claude Haiku 5.5 | **14 (82%)** | **60** | **7 (6%)** | about 60 cents |
| gpt-oss-120b | 10 (59%) | 59 | **7 (6%)** | about 30 cents |
| gpt-oss-20b | 9 (53%) | 59 | 18 (15%) | about 10 cents |

What to keep in mind:

- **The test set is small.** With 17 real mistakes the ranges are wide: Haiku's 82% has a 95% interval of 59–94%.
- **Wrong amounts are caught best.** All three models catch most charges that differ from the price the agent quoted.
- **Two blind spots.** Every model mostly misses a charge whose price the agent never stated. Only Haiku catches most wrong details (3 of 4).
- **Airline only for money.** The money check reads the airline tools' `payment_history`, so on other agents only the other four checks apply.

The full method, labels and per-chat results are in the [tattletale report](https://github.com/Vidushi2709/-tattletale/blob/main/report.md).

## Test

From the [repository](https://github.com/Vidushi2709/-tattletale/tree/main/tattlescan):

```bash
python test_tattlescan.py
```

It runs both scanners on two small made-up chats with Inspect's mock model, so it needs no API key.

## License

MIT
