truthtableai 0.0.0-stage → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,108 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # truthtableai
2
+
3
+ Test an AI data copilot (a chat that answers questions from your database) for two things that cost you trust: **confident wrong answers** and **successful attacks**. Every answer is judged from the result table the copilot returns, not from its wording, against answer keys computed from your own data. You get two numbers, counted.
4
+
5
+ TruthTable AI runs on your machine. It is used through Claude Code (MCP server plus a skill), or from the command line.
6
+
7
+ ## Install
8
+
9
+ Requires Node.js 22 or newer.
10
+
11
+ ```sh
12
+ npx truthtableai init
13
+ ```
14
+
15
+ `init` creates the `.truthtable/` workspace in the current folder, installs the Claude Code skill (`.claude/skills/truthtable/SKILL.md`) and registers the MCP server in `.mcp.json` (pinned to the installed version; running `init` from a newer version updates that entry). Use `--user` to install the skill for your user instead of the project, `--no-claude` for the workspace only.
16
+
17
+ ## First sentence to say in Claude Code
18
+
19
+ Open Claude Code in that folder and say:
20
+
21
+ > test my copilot
22
+
23
+ (Turkish works too: "copilot'umu test et".) Claude finds your sources, drafts a question set with answer keys, asks you to approve them, runs the copilot and shows the report.
24
+
25
+ ## Try it without setup
26
+
27
+ ```sh
28
+ npx truthtableai demo
29
+ ```
30
+
31
+ Runs a built-in sample copilot against a built-in bike-shop warehouse (3 rounds, Turkish) and prints the report head: how many answers were confidently wrong, and how many attacks succeeded.
32
+
33
+ ## Local panel
34
+
35
+ ```sh
36
+ npx truthtableai panel
37
+ ```
38
+
39
+ Serves a read-only view of your sets and runs on `127.0.0.1` and opens it in the browser. It loads no external resources. Options: `--port N`, `--no-open`.
40
+
41
+ ## Commands
42
+
43
+ | Command | What it does |
44
+ | --- | --- |
45
+ | `demo [--out <dir>]` | run the sample copilot against the sample warehouse |
46
+ | `init [--user] [--force] [--no-claude]` | create the workspace, install the skill, register the MCP server |
47
+ | `import <file> --name <set>` | import your questions from `.csv`, `.xlsx` or `.json` |
48
+ | `compute --set <set>` | fill expected answers by running each item's reference SQL (read-only) |
49
+ | `run --set <set> --target <target>` | ask the target every question, judge, write a report |
50
+ | `judge --run <run> --set <set>` | judge a run again from its raw log |
51
+ | `report --run <run>` | print a run's `report.md` |
52
+ | `compare <runA> <runB>` | pairs fixed, broken and unstable between two runs |
53
+ | `panel [--port N] [--no-open]` | local read-only panel |
54
+ | `mcp` | serve the MCP tools on stdio (started by Claude Code from `.mcp.json`) |
55
+
56
+ Run `truthtableai <command> --help` for all options.
57
+
58
+ ## Targets and sources
59
+
60
+ Targets (the AI under test): `http` (any JSON endpoint, with bearer or login auth), `openai` (OpenAI-compatible chat), `command` (a program that reads a question on stdin and prints the result table), `demo`.
61
+
62
+ Sources of truth (read-only): SQLite, PostgreSQL, MySQL, SQL Server, and the bundled sample. Every query is checked to be a single read-only statement and runs in a read-only transaction. Prefer a database login that has read-only rights as well.
63
+
64
+ Secrets are never written to config: use environment variable names (`connectionStringEnv`, `tokenEnv`, `{{env:NAME}}`).
65
+
66
+ ### SQL Server
67
+
68
+ The connection verifies the server certificate by default. A server with a self-signed certificate (typical for local and test instances) needs `"trustServerCertificate": true` in that source's config. Only set it for servers you trust.
69
+
70
+ ## Privacy
71
+
72
+ - Runs locally. No telemetry. The demo needs no key and no account.
73
+ - A free key needs an email signup at the license service (https://license.truthtableai.com).
74
+ - The one call the product makes on its own is a single activation record, `{ key id, tool version }`, sent when you run `truthtableai license activate`. A key with the offline feature skips it. Nothing else is ever sent.
75
+ - Your data stays in `.truthtable/` in your project folder (runs are git-ignored by `init`).
76
+ - Sources are read-only. The tools never show an environment variable's value.
77
+ - Other network traffic is what you configure: your sources and the target under test. Getting the tool itself: `npx` downloads the `truthtableai` package from the npm registry (the MCP entry `init` writes pins the version, e.g. `truthtableai@0.2.2`, so Claude Code runs the same version as the installed skill).
78
+
79
+ ## License
80
+
81
+ The code is proprietary and closed. Using it needs a license key, and a key is free to get.
82
+
83
+ | Tier | What you get |
84
+ | --- | --- |
85
+ | No key | `demo` and the sample source: try the whole tool on the bundled sample copilot. |
86
+ | Free key | Test your own AI (any target) in **1 project**. The key binds to the first project you use it in. |
87
+ | Pro | Any number of projects, `compare`, CI thresholds, HTML acceptance report (coming), paid rule packs. |
88
+ | Enterprise | Pro, with a key that checks nothing online (works fully offline). |
89
+
90
+ ### Get a free key
91
+
92
+ Open https://license.truthtableai.com/ (`truthtableai license` prints the address when you have no key), enter your email, follow the link in the message and copy the key. Then:
93
+
94
+ ```
95
+ truthtableai license activate <key>
96
+ truthtableai license # show the tier, owner, expiry and features
97
+ truthtableai license remove # delete the saved key
98
+ ```
99
+
100
+ The key is saved under `~/.truthtable/`. In CI, set the key in the `TRUTHTABLE_LICENSE` environment variable instead of activating it; it takes precedence over the saved key.
101
+
102
+ ### CI thresholds (Pro)
103
+
104
+ `truthtableai run ... --max-wrong N --max-breached N` exits with code 3 when confident wrong answers or breached security pairs exceed the limits. Exit codes: 0 ok, 1 error, 2 usage error, 3 threshold exceeded, 130 cancelled.
105
+
106
+ ### What activation sends
107
+
108
+ Activating a key sends one record, `{ key id, tool version }`, and nothing else: no data, questions, results, project names, email or connection details. This is the only network call the tool makes of its own, and an enterprise (offline) key makes none. Keys are checked offline against a signature; nothing is looked up when you run tests.