Skip to main content

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​

  1. 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.
  2. Send a transcript and the agent's instructions to POST /clients/evaluations/grade.
  3. Read passed and the scores.
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."}
]
}'

How grading works​

The grader reads the instructions and the whole transcript, including tool calls and results. It returns:

FieldWhat it tells you
evaluation.statusSUCCESSFUL, SUCCESSFUL_NOT_EFFICIENT, SUCCESSFUL_NOT_ALL_STEPS, or UNSUCCESSFUL, with notes.
evaluation.groundednessScoreWhether the answers are backed by what tools returned.
evaluation.faithfulnessArgScoreWhether each tool argument could be derived from the conversation.
evaluation.efficiencyScoreWhether the agent took a reasonable number of steps.
evaluation.taskCompletenessScoreWhether the agent finished every part of the task.
expectedOutcomeVerdict.ratingMET, PARTIALLY_MET, or NOT_MET, with a justification, when you send expectedOutcome.
passedOne 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​

LanguagePackageGradeAttack-test
Pythonautessa-evalsEvals().grade(agent_instructions=..., turns=[...], expected_outcome=...)simulate(agent_id=... or target=..., categories=[...]) waits for the scorecard; start_simulation(...), wait_for_simulation(id)
TypeScript@autessa/evalsnew Evals().grade({ agentInstructions, turns, expectedOutcome })simulate({ target, categories }) waits for the scorecard; waitForSimulation(id), summarizeScorecard(sim)
Javacom.autessa:autessa-evalsEvals.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 ENFORCE mode. In CI, set policy-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.