Self-hosted platform available now Runs locally or in CI Deterministic security checks

Catch agent regressions
before they ship

Open-source security and quality testing for AI agents. Fail CI on forbidden actions, canary leaks, missing approvals, and degraded behavior—then keep every run on infrastructure you control.

No login · Sample data · Fully interactive

Prefer managed hosting? Join the Cloud waitlist →

import tokensurf as ts

@ts.tool
def web_search(query: str): ...

@ts.track  # capture the agent's complete trajectory
def research_agent(question: str):
    sources = web_search(question)
    return synthesize(question, sources)
20
Built-in scorers
Local + CI
No server required
Python-first
Simple decorators
Open source
Apache-2.0
Public interactive demo

See TokenSurf with data already flowing

Explore real dashboard workflows with populated projects, agent traces, security scores, and x402 economics. Click around before installing anything.

No account Sample data Interactive
tokensurf.io/demo
Overview
Runs
Scorers
Economics
Research agent Sample data
94%pass rate
128runs
$3.84x402 spend
run #1043research-agentpassed
run #1042invoice-agentpassed
run #1041support-agentfailed

Quickstart

Turn an agent run into a testable trajectory, then fail CI when its tools, spend, security, or quality regress.

import tokensurf as ts

@ts.tool
def web_search(query: str) -> list[str]:
    return search_the_web(query, limit=3)

@ts.track  # capture output, tool calls, cost, and timing
def research_agent(question: str) -> str:
    sources = web_search(question)
    return synthesize(question, sources)

data = ts.Dataset.from_list([
    {"input": "What changed in the latest Python release?"},
    {"input": "Compare two approaches to agent memory."},
])

report = ts.evaluate(task=research_agent, data=data, scorers=[
    ts.ToolSequence(expected=["web_search"]),
    ts.StepBudget(max_steps=6),
    ts.NoCanaryLeak("TS_CANARY_test-only"),
])
ts.assert_eval(report, min_pass_rate=1.0)  # fail CI

Agents can fail quietly—and act unsafely

A prompt, model, or tool change can degrade the answer, bypass an approval, or expose data without throwing a single exception.

Silent quality regressions

A model swap or prompt edit passes your unit tests but quietly degrades answer quality. Nothing errors — it just gets worse.

Unsafe tool use

The agent calls a forbidden tool or performs a sensitive action before approval. The final answer can still look perfectly normal.

Data and canary leaks

Protected test data reaches the final response or a tool input. Without a regression test, you discover it after deployment.

How It Works

Decorate behavior, run cases, get one pass/fail report. Tool calls and approvals fit the same eval flow.

@track Step 1

Decorate behavior

Use @ts.track, @ts.tool, and @ts.approval. Ordinary Python functions become one testable trace.

🧪 Step 2

Run test cases

Mix security, economics, deterministic, reference, trajectory, and LLM-judge scorers. Attack prompts are ordinary dataset cases.

📋 Step 3

Get a pass/fail report

A pass/fail report in CI blocks unsafe or degraded behavior. Send the same run to the self-hosted UI when you want history.

Framework-agnostic — works with LangChain, LlamaIndex, or plain Python. Read the security guide →

Six scorer families. One report.

Security and economics checks are native TokenSurf scorers—not separate tools. Mix them with quality and trajectory checks in the same CI gate.

Security · deterministic and free

Catch unsafe agent behavior in CI

Fail on forbidden tool calls, synthetic canary leaks, and sensitive actions without prior approval. No model call and no cloud service required.

ForbiddenToolCalledNoCanaryLeakApprovalRequired
LLM-judge

Model-graded quality

Score accuracy, completeness, relevance, and helpfulness on a 1–10 scale (normalized to 0–1). Provider-agnostic via litellm — judge with any model.

accuracycompletenessrelevancehelpfulness
Deterministic

Exact, rule-based checks

Fast, free, and repeatable — no model call. Assert the structural facts a correct run must satisfy.

ExactMatchRegexJSONSchemaValidToolCalledLatencyUnder
Reference-based

Compare to expected

Embedding similarity against a known-good answer — catch drift when there's no single exact string to match.

EmbeddingSimilarity
Agent-trajectory · the differentiator

Grade the whole run

Most tools score only the final answer. These grade the entire multi-step trajectory — the tool calls, their order, and how the agent recovers.

ToolSequenceNoLoopsStepBudgetTaskCompletionRecovery
Economics · x402-aware

Keep autonomous spend bounded

Test payment cost, count, and recipient allowlists alongside the behavior that caused the spend.

PaymentCostUnderPaymentCountAtMostPaymentRecipientsAllowed

Run locally. Add the UI when you want it.

The Python library works by itself. The open-source server adds durable run history and a dashboard on your infrastructure.

Library · local or CI

Decorators and pass/fail tests

Start without deploying a service.

  • Capture tools and approvals with decorators
  • Run security + quality scorers offline
  • Fail pytest or CI when behavior regresses
Platform · self-hosted

Server and dashboard

Keep the results your team needs to inspect.

  • Store eval runs in your own Postgres
  • Inspect per-case and per-scorer results
  • See pass-rate history by project

Run your own quality platform

Not just a library — a self-hostable platform. The SDK runs evals; the server stores every run, shows trends over time, and is where you configure everything. Your data never leaves your infrastructure.

Self-hosted, on your infrastructure

Run the server, the dashboard, and a Postgres database yourself. Your eval data and your agents' inputs and outputs stay inside your trust boundary — the answer to the data-residency objection.

One command to start — but Docker's optional

docker compose up brings up the app and Postgres together as the easy path. Prefer your own setup? It's a standard service that runs against any Postgres you already have.

Your runs, remembered

Every eval run is stored and charted over time, organized by project — one project per repo or app. See pass-rate trends, not just the last run.

Python SDK Server + dashboard Postgres Your infra
tokensurf · dashboard preview
project: support-agent pass-rate, last 8 runs
run #10420.90pass
run #10410.78fail
run #10400.88pass
run #1039errored
🔔

Notifications

Ping Slack, email, or a webhook when quality regresses — so a bad run finds you, not your users.

🚫

Quality gates

Set thresholds like "fail the build if pass-rate < 90%." Wire eval results straight into CI.

⚙️

Centralized config

Configure scorers and your own judge keys once on your server; CI pulls the config centrally.

The server & dashboard are open source and self-hostable today. The Python SDK is the runner that feeds them.

Pricing

Self-host free, or join the cloud waitlist. No per-request fees, no lock-in.

Open Source

Free

Self-host the whole platform. Free forever, Apache-2.0.

  • SDK + server + dashboard
  • All six scorer families
  • Your own Postgres database
  • Your trust boundary, your keys
  • Community support
Self-host — get it on GitHub
TokenSurf Cloud

Early access Waitlist

Hosted eval storage and dashboard, managed for your team. Pricing at general availability.

  • Everything in open source
  • Hosted storage + dashboard
  • Managed Postgres + backups
  • Team roles & collaboration
  • Priority support
Join the waitlist

Enterprise needs — SSO, on-prem support, custom scorers?

Talk to us

Ship agents you can trust

Explore the dashboard with sample data, then self-host the complete open-source platform when you are ready.

import tokensurf as ts

@ts.track  # flight recorder for the whole run
def research_agent(question):
    sources = web_search(question)
    return synthesize(question, sources)

report = ts.evaluate(task=research_agent, data=data, scorers=[
    ts.ToolSequence(expected=["web_search"]),
    ts.StepBudget(max_steps=6),
    ts.NoCanaryLeak("TS_CANARY_test-only"),
])
ts.assert_eval(report, min_pass_rate=1.0)  # fail CI
Prefer managed hosting? Join the Cloud waitlist →

Frequently asked questions

Agent security, quality testing, and self-hosting—answered.

What is AI agent evaluation?
AI agent evaluation measures whether an agent does its job correctly — right answers, correct tool use, no loops — by running it against test cases and scoring the results. TokenSurf runs these evals in CI so quality regressions are caught before they ship.
How do you test AI agents?
Decorate your agent with @ts.track and its behavior with @ts.tool and @ts.approval. Run ts.evaluate() with security and quality scorers, then use ts.assert_eval() to fail CI when a check regresses.
What AI agent security issues can TokenSurf test?
TokenSurf includes deterministic checks for forbidden tool calls, synthetic canary leaks, and sensitive tool calls without prior approval. These are regression tests over observed behavior—not a production sandbox—and you can add project-specific rules as ordinary Python scorers.
Can I self-host TokenSurf?
Yes. TokenSurf is a self-hostable platform — the SDK, server, dashboard, and a Postgres database run on your own infrastructure, so your eval data and your agents' inputs and outputs never leave your environment. Open source on GitHub.
Does TokenSurf sit in my data path?
No. TokenSurf observes runs through the @track decorator; it never sits between your app and the model, so it can't add latency or a point of failure to production.
Do I need to run the TokenSurf server to test an agent?
No. The Python library runs evaluations locally or in CI without a server. Add the optional self-hosted server and dashboard when you want durable run history and a shared UI.
Is TokenSurf open source?
The platform is open source under Apache-2.0: github.com/Cem-Bas/TokenSurf-Open. TokenSurf Cloud offers the same platform hosted for you, in early access.