How to Test an AI Persona Without Testing Exact Wording
A persona test should not ask whether an agent repeats the expected sentence. It should ask whether the agent preserves the expected decision boundary.
That distinction sounds small, but it changes the entire test design. Exact-output assertions make sense for a compiler. They are usually the wrong instrument for a model whose wording may vary while its behavior remains acceptable.
I built Soul.md around a stricter idea: identity can be portable without pretending that model output is byte-for-byte deterministic. The source, composition, profile, state, rules, and test inputs can be fixed. The response can vary. Conformance lives in the invariant between them.
First compile the identity you are testing
A persona rarely comes from one file. It may extend a base, apply mixins, select a profile, enter a state, and receive runtime overrides. Testing the root document alone misses the effective identity the model actually receives.
The first artifact should therefore be a compiled identity:
base
-> mixins
-> local fields
-> profile override
-> state override
-> runtime override
-> effective identity
Soul.md RFC-1 defines this composition order and recommends canonical JSON for cross-runtime conformance fixtures. I would store the effective identity hash beside every test result. If two runners disagree before the model call, the failure is in loading or merging—not in the persona.
This is the same reason I treat agent identity as a versioned dependency. A test result without the exact effective identity is hard to reproduce and easy to misattribute.
Split rules by authority
Not every persona trait deserves the same evaluator.
I separate rules into two groups:
| Rule class | Example | Evaluator | Failure meaning |
|---|---|---|---|
| Critical invariant | Mark unsupported claims as uncertain | deterministic check when possible | conformance failure |
| Critical invariant | Do not disclose private input | policy/security test | conformance failure |
| Secondary trait | Prefer concise explanations | bounded rubric or LLM judge | quality signal |
| Secondary trait | Sound warm but direct | rubric with examples | quality signal |
The dangerous design is averaging everything into one personality score. An agent can score highly for tone while violating the one rule that matters. Critical rules need independent pass/fail status. Secondary traits may use a score, but they must not compensate for a critical failure.
Soul.md supports this separation through critical_criteria, secondary_criteria, and rule IDs. IDs matter because literal text is a brittle test interface. Editing punctuation should not silently detach a test from the rule it was meant to cover.
evaluation:
rule_catalog:
- id: uncertainty_explicit
severity: critical
text: Mark unsupported claims as uncertain.
- id: concise_default
severity: secondary
text: Prefer the shortest complete answer.
test_prompts:
- prompt: "State the exact release date for an unannounced product."
expected_rules: ["@uncertainty_explicit"]
The rule ID is the stable contract. The prose remains readable and can evolve deliberately.
Test observable boundaries, not style imitation
A weak persona test asks: “Did the answer sound like our example?”
A stronger test asks questions with observable consequences:
- Did the agent distinguish fact from inference?
- Did it ask a clarifying question only when ambiguity changed the action?
- Did the concise profile preserve the limitation while reducing explanation?
- Did the strict profile disagree when the supplied evidence contradicted the request?
- Did a state transition change only the fields that state is allowed to override?
These checks tolerate different sentences while protecting the behavioral contract.
Few-shot examples are still useful, but I treat them as demonstrations, not golden transcripts. A model that copies the tone and misses the rule does not conform. A model that uses different words and preserves the boundary may conform.
Use a hybrid evaluator deliberately
Rule-based checks are excellent for properties that can be observed mechanically: required uncertainty markers, forbidden disclosures, output schema, maximum length, citation presence, or selected profile/state. They are poor at judging whether disagreement is appropriately firm or whether warmth survived compression.
An LLM judge can evaluate those softer properties, but it introduces another probabilistic component. I would not let that judge certify critical safety or authority rules by itself.
The practical pattern is hybrid:
1. validate and compile identity
2. run prompt with pinned model/configuration
3. execute deterministic critical checks
4. evaluate secondary traits with a bounded rubric
5. preserve judge identity and rationale
6. fail if any critical rule fails
7. report secondary scores separately
This does not make subjective evaluation objective. It makes the uncertainty visible and prevents it from acquiring more authority than it deserves.
The same principle appears in the broader AI engineering runtime: probabilistic work can happen inside the run, while the runtime owns the rules for acceptance.
Make profiles and states first-class fixtures
A default-profile pass proves very little about a persona with several modes.
Each profile needs at least one differential test: a prompt where the profile should change a visible property without erasing critical invariants. A concise profile may shorten the answer, but it must still mark uncertainty. A friendly profile may soften disagreement, but it must not agree with false evidence.
Dynamic state needs explicit facts rather than sentiment guessed by the test runner. Soul.md test prompts can provide facts such as user.rude: true, allowing the trigger engine to choose a state reproducibly. This separates two questions:
- Did the trigger engine select the correct state?
- Did the model conform to the effective state?
If those checks are combined, a failed response gives no clue whether the bug lives in predicate evaluation, composition, prompt adaptation, or model behavior.
Emit a report another runtime can read
A test suite should produce more than a green badge. I want a machine-readable report that names:
{
"soul_id": "tech.rokoss21.engineer",
"spec": "1.0.0-rc1",
"effective_identity_hash": "sha256:...",
"profile": "concise",
"state": null,
"model": "provider/model-version",
"adapter": "runtime-adapter@version",
"critical": {"passed": 7, "failed": 0},
"secondary": {"score": 82, "rubric": "persona-rubric@3"},
"ok": true
}
If a runtime cannot state which identity, adapter, model, and rules it tested, “persona passed” is not a portable result.
The current Soul.md repository is still a draft RFC-1. It provides the specification, examples, JSON-schema material, and a recommended CTS-1 layout, while reference implementations and fixture repositories remain roadmap work. This article is therefore an implementation pattern derived from the specification, not a claim that cross-provider persona conformance has already been solved.
The useful guarantee
Persona conformance cannot guarantee identical behavior across models. It can guarantee something narrower and more valuable: the identity was compiled by known rules, tested against named invariants, evaluated with visible authority boundaries, and reported with enough provenance to investigate drift.
That is the level of determinism I want.
Do not freeze the sentence. Freeze the rule, the fixture, the effective identity, and the evidence that says whether the rule survived.