Test agent permissions with Chalk evals
This demo shows agent evaluations on Chalk, testing permissions and checking for restricted data across users and access policies. Choose a person and a task to try it, then explore the code to see how it works.
Test an identity
Choose a person and a task, or write your own request.
Inspect each tool call to see whether it was allowed and which rule was applied.
Run the same request under different identities or policy bundles. Inspect the tool’s allow/deny decisions, then compare them with the recorded Chalk evaluation below.
All people and records in this demo are fictional. Policy 2026.10.1 has a known error that exposes member emails; 2026.10.2 restricts access to approved columns.
Compare two access policies
Explore the same 25 cases run against two policy versions. Select a result to inspect the agent's tool calls, permission checks, and data-leak checks.
Start with the email leak the evaluation caught
Same analyst. Same request for member emails. Select a policy below to inspect the tool decision; both cases should deny access.
The full results below also include an unproven case: the model refused without attempting the restricted tool call, so that run did not test tool enforcement.
Policy 2026.10.1 gates analyst reports with a column denylist that was written before the email column was added to members. The evaluation catches what it lets through.
25 cases · permission and data-leak checks
| Member | Support rep | Analyst | Admin | |
|---|---|---|---|---|
| Read own claims | — | — | — | |
| Read another member's claims | ||||
| Read a full SSN | ||||
| Refund $40 | ||||
| Refund $750 | — | |||
| Aggregate claims report | ||||
| Report with member emails | — | — | ||
| Prompt-injected export | — |
Built on Chalk
Chalk runs the agent and its scorers, then records the evaluation results. Compare access policies to see which actions were allowed and whether restricted data reached the output.
Test cases for your access rules
Define identities, tasks, and expected outcomes in a Chalk evaluation dataset. Run the agent against allowed and forbidden requests.
Score actual tool decisions
Run a custom scorer on Chalk to check whether the tool layer enforced each rule. A model refusing without attempting the restricted action leaves enforcement unproven.
Check for exposed data
Use a second scorer to look for specified restricted values in tool results and the final answer. A match fails the data-leak check.
Compare policies and traces
Run the same cases before and after a policy change, then inspect the tool calls behind each result.
Run it on your own
Clone the example and run the evaluation. It deploys the agent and two scorers as Chalk functions, then runs the 25 cases against both policy versions.
You will need uv, a Chalk environment with the model router enabled, and a router key stored as CHALK_ROUTER_API_KEY. To test your own agent, adapt the identities, tasks, restricted values, and tool traces to your access rules.
git clone https://github.com/chalk-ai/identity-evals
cd identity-evals
chalk login
# 25 persona x task cases, once per policy bundle
./run_eval.py
# The interactive page: pick a persona, ask, watch each authorization
./deploy.pyTest your agent’s access rules
Talk to an engineer about evaluating agent permissions and data access with Chalk.