Evaluations and attack simulator
Evaluations grade what your agent did in a conversation. The attack simulator tries to trick your agent, then scores how much got through.
When to use it
- You changed a prompt or model and want to know if the agent still does its job.
- You want a pass or fail check on every pull request. See GitHub Actions.
- You want proof that your agent resists prompt injection and social engineering before release.
Quickstart
- Get a free API key. New accounts get $100 of free credits for your first month, no card needed. This developer key works for this feature; see Keys.
- Send a transcript and the agent's instructions to
POST /clients/evaluations/grade. - Read
passedand the scores.
- curl
- Python
- TypeScript
- Java
curl -X POST https://api.autessa.com/clients/evaluations/grade \
-H "Authorization: $AUTESSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentInstructions": "You help customers check order status. Look up the order before answering.",
"expectedOutcome": "The agent looks up order 1042 and gives its delivery date.",
"turns": [
{"role": "USER", "content": "Where is order 1042?"},
{"role": "TOOL_CALL", "toolName": "get_order", "arguments": {"orderId": "1042"}},
{"role": "TOOL_RESULT", "toolName": "get_order", "result": "{\"status\":\"shipped\",\"eta\":\"2026-11-07\"}"},
{"role": "ASSISTANT", "content": "Order 1042 has shipped and should arrive November 7."}
]
}'
import os
import requests
res = requests.post(
"https://api.autessa.com/clients/evaluations/grade",
headers={"Authorization": os.environ["AUTESSA_API_KEY"]},
json={
"agentInstructions": "You help customers check order status.",
"expectedOutcome": "The agent gives the delivery date for order 1042.",
"turns": [
{"role": "USER", "content": "Where is order 1042?"},
{"role": "ASSISTANT", "content": "Order 1042 should arrive November 7."},
],
},
timeout=120,
)
grade = res.json()
print(grade["passed"], grade["evaluation"]["status"])
const res = await fetch("https://api.autessa.com/clients/evaluations/grade", {
method: "POST",
headers: { Authorization: process.env.AUTESSA_API_KEY!, "Content-Type": "application/json" },
body: JSON.stringify({
agentInstructions: "You help customers check order status.",
expectedOutcome: "The agent gives the delivery date for order 1042.",
turns: [
{ role: "USER", content: "Where is order 1042?" },
{ role: "ASSISTANT", content: "Order 1042 should arrive November 7." },
],
}),
});
const grade = await res.json();
console.log(grade.passed, grade.evaluation.status);
var body = """
{"agentInstructions": "You help customers check order status.",
"expectedOutcome": "The agent gives the delivery date for order 1042.",
"turns": [{"role": "USER", "content": "Where is order 1042?"},
{"role": "ASSISTANT", "content": "Order 1042 should arrive November 7."}]}
""";
var req = java.net.http.HttpRequest.newBuilder(java.net.URI.create("https://api.autessa.com/clients/evaluations/grade"))
.header("Authorization", System.getenv("AUTESSA_API_KEY"))
.header("Content-Type", "application/json")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString(body))
.build();
System.out.println(java.net.http.HttpClient.newHttpClient()
.send(req, java.net.http.HttpResponse.BodyHandlers.ofString()).body());
How grading works
The grader reads the instructions and the whole transcript, including tool calls and results. It returns:
| Field | What it tells you |
|---|---|
evaluation.status | SUCCESSFUL, SUCCESSFUL_NOT_EFFICIENT, SUCCESSFUL_NOT_ALL_STEPS, or UNSUCCESSFUL, with notes. |
evaluation.groundednessScore | Whether the answers are backed by what tools returned. |
evaluation.faithfulnessArgScore | Whether each tool argument could be derived from the conversation. |
evaluation.efficiencyScore | Whether the agent took a reasonable number of steps. |
evaluation.taskCompletenessScore | Whether the agent finished every part of the task. |
expectedOutcomeVerdict.rating | MET, PARTIALLY_MET, or NOT_MET, with a justification, when you send expectedOutcome. |
passed | One boolean you can gate on. With expectedOutcome, it is true when the rating is MET. Without it, true when the status is SUCCESSFUL or SUCCESSFUL_NOT_EFFICIENT. |
Each turn has a role of USER, ASSISTANT, TOOL_CALL, or TOOL_RESULT. USER and ASSISTANT turns need content. TOOL_CALL turns take toolName and arguments, and TOOL_RESULT turns take toolName and result.
For many transcripts, use POST /clients/evaluations/jobs Preview and get a webhook when the job finishes.
Attack simulator
The simulator runs packs of attacks and scores the result.
curl -X POST https://api.autessa.com/clients/aaf/simulations \
-H "Authorization: $AUTESSA_API_KEY" -H "Content-Type: application/json" \
-d '{"categories": ["PROMPT_INJECTION", "SOCIAL_ENGINEERING", "DISCLOSURE_PROBING"]}'
You get a simulationId. Poll GET /clients/aaf/simulations/{simulationId} until status is COMPLETED or FAILED (errorMessage says why). The scorecard has one row per category with attempts, blocked, flagged, and passed (attacks that got through, so lower is better). A row with available: false could not run.
Categories: PROMPT_INJECTION, SOCIAL_ENGINEERING, PASSPHRASE_GUESSING, WORD_OF_DAY_REPLAY, ANOMALY, DISCLOSURE_PROBING, CLONED_VOICE. Leave out categories to run them all.
Targets: an Autessa agent (agentId, with tools dry-run), a named firewall policy (policyName), or your company's default policy.
Attack your own agent
Point the simulator at any agent with an HTTPS endpoint. It sends each attack to your endpoint and judges the reply with the same scorers.
{
"categories": ["PROMPT_INJECTION"],
"target": {
"url": "https://agent.example.com/chat",
"method": "POST",
"headers": { "X-Api-Key": "my-agent-key-secret" },
"requestTemplate": { "message": "{{message}}", "session": "{{sessionId}}" },
"responsePath": "$.reply",
"multiTurn": true
}
}
headers maps a header name to the name of an Autessa Secret that holds its value, so the key never sits in the request. In requestTemplate, "{{message}}" and "{{sessionId}}" are filled in for each attack. responsePath is a JSONPath to the reply text in your response.
Languages and multi-turn attacks
Add "languages": ["en", "es"] to run attacks in English and Spanish, and "multiTurn": true to run each attack as a multi-turn conversation.
Libraries
| Language | Package | Grade | Attack-test |
|---|---|---|---|
| Python | autessa-evals | Evals().grade(agent_instructions=..., turns=[...], expected_outcome=...) | simulate(agent_id=... or target=..., categories=[...]) waits for the scorecard; start_simulation(...), wait_for_simulation(id) |
| TypeScript | @autessa/evals | new Evals().grade({ agentInstructions, turns, expectedOutcome }) | simulate({ target, categories }) waits for the scorecard; waitForSimulation(id), summarizeScorecard(sim) |
| Java | com.autessa:autessa-evals | Evals.fromEnv().grade(instructions, turns, expectedOutcome) | simulateAndWait(target, categories) returns a Scorecard; simulate(...) returns the id, then waitForSimulation(id) |
For your own endpoint, build the target with external_target(...) in Python or SimulationTarget.external(...) in Java. In TypeScript, pass target: { url, requestTemplate, responsePath }.
from autessa.evals import Evals, turn
evals = Evals()
result = evals.grade(
agent_instructions="You help customers check order status.",
turns=[turn("USER", "Where is order 1042?"), turn("ASSISTANT", "Order 1042 should arrive November 7.")],
expected_outcome="The agent gives the delivery date for order 1042.",
)
print(result.passed, result.expected_outcome_verdict.rating)
The libraries are in private preview and not yet on PyPI, npm, or Maven Central. Install from GitHub as each library's README describes. The HTTP API works today.
Limits
- Grading reads the whole transcript in one call. Send long batches as a job.
- A company with no firewall policy can still run the simulator. Attacks are flagged, not blocked, so the block rate stays at 0 until you run against a policy in
ENFORCEmode. In CI, setpolicy-name. - A simulation run costs a flat 25 firewall points by default; the inspections inside it are not billed separately. See firewall billing.
API reference
Benchmarks
AI Firewall Bench is the open benchmark behind the attack categories.
Example
Eval before release (CI): attack-test an agent on every pull request and fail the check when too much gets through.
Related
- GitHub Actions: eval on every pull request
- AI Application Firewall
- Synthetic data for test conversations
- Start here