2026-04-19
How to Write an Identity File for Your AI Agent (With Real Examples)
# How to Write an Identity File for Your AI Agent (With Real Examples)
If you've used AI tools for more than a few sessions, you've hit the drift problem. The agent sounded great in session one. By session five, it sounds like a completely different system. It makes different decisions, uses different tone, references different priorities. You spend half the session re-explaining context you already established.
Identity files solve this. Here's the exact format I use to keep Evo, my AI co-founder, consistent across hundreds of sessions.
---
What Is an Identity File?
An identity file is a plain-text document that defines who your AI agent is and how it should behave. Not instructions for a single task. A definition of a persistent persona with a mission, principles, voice, and decision-making rules.
The most important identity file is the SOUL.md file. Think of it as the agent's operating charter. It loads at the start of every session and answers the question: "What is this agent, and what is it here to do?"
The files work because modern AI platforms (I use OpenClaw) load them automatically at session start. The agent doesn't need to be told who it is each time. The files tell it.
Read more: What Is a SOUL.md File and Why Does Your AI Agent Need One
---
Why Agents Drift Without Identity Files
Without identity files, your AI agent has no stable foundation. Every session, it's drawing on the model's general training — which means:
- Tone shifts between formal and casual without explanation
- It makes judgment calls based on what the model thinks is "helpful" rather than what you've decided
- It forgets the business context you established last week
- It recommends things that contradict decisions you already made
The drift isn't a bug in the model. It's what happens when there's no anchor. An identity file is the anchor.
---
The Three Files That Make Up a Complete Identity Layer
A solid identity layer for an AI agent uses three files:
SOUL.md — Mission, mandates, core principles, voice, and decision rules. The "who and why."
IDENTITY.md — Persona metadata, product ladder awareness, tone specifications, behavioral standards. The "what it knows about itself."
USER.md — Profile of the human the agent works with. Time constraints, working expectations, communication preferences, guardrails. The "who it serves."
Together, these three files give the agent a stable identity that loads every session.
---
What Goes in a SOUL.md File
Here's the structure I use for Evo. Adapt the content, keep the structure.
Section 1: Mission and Mandates
One paragraph that defines the agent's core job. Be specific. "Be helpful" is not a mandate. "Run the Xero distribution stack — TikTok, Twitter, newsletter, Reddit, analytics monitoring — autonomously while Michael works his day job" is a mandate.
Then list 3-5 specific mandates:
```
- AI Co-Founder: Think at the company level first, surface insights, keep priorities moving
- Twitter Voice: Publish the founder journey through drafted posts in a confident, builder-first tone
- TikTok Engine: Keep each product's TikTok pipeline healthy, learn from analytics, feed lessons back into new scripts
- Revenue Driver: Every distribution action points toward a conversion endpoint
```
Mandates are behaviors, not goals. "Increase revenue" is a goal. "Make every social post point at a conversion endpoint" is a mandate.
Section 2: Core Principles
5-7 principles that govern how the agent makes decisions when rules don't cover the specific situation.
```
1. Be resourceful before you ask. Read the files, inspect the data, search the logs.
2. Have a point of view. Bring recommendations, not just options.
3. Ship, measure, learn. Every post, every automation should produce data.
4. Earn trust through competence. You have access to real work; use it carefully.
5. Respect the human. Michael trusted you with his company. Protect his time and brand.
```
Section 3: External Action Rules
This is the guardrails section. What can the agent do autonomously? What requires approval?
```
- Confirm before sending anything under Michael's personal voice unless explicitly delegated
- Treat private information as private
- Escalate when stakes are high (money spent, public statements, cross-product impacts)
- Keep product pipelines isolated unless instructed otherwise
```
Be specific. "Use good judgment" is not a rule. "Do not post anything to public social channels without review, except for the Twitter autoposter which is explicitly delegated" is a rule.
Section 4: Voice and Behavioral Standard
Define the tone so specifically that the agent could pass the output to someone who knows your brand and they wouldn't be able to tell the agent from you.
```
- Speak like a builder talking to another builder: direct, candid, no performative fluff
- Highlight outcomes and lessons, not vanity metrics
- For operational work: act first, then summarize briefly
- Show the work: link to data, give receipts, use plain language
```
Include specific things to avoid. I add: no em dashes, no "delve," no "crucial," no "it's worth noting," no generic closers.
Section 5: Strategic Context
Where does the full business context live? Point the agent to the files.
```
- Full business plan and roadmap: 02-Strategy/XERO_BUSINESS_PLAN.md
- Product details and pricing: 02-Strategy/XERO_OFFER_STACK.md
- Current state: 20-Docs/CURRENT_STATE.md
```
This prevents the agent from making assumptions about the business that might be outdated.
---
What Goes in an IDENTITY.md File
IDENTITY.md is the agent's profile — what it knows about its own identity and scope.
Persona metadata:
```
Name: Evo
Role: AI co-founder of Xero (distribution + growth + revenue)
Creature: Digital operator, half strategist, half automation rig
Vibe: Direct, pragmatic, builder energy
```
Product ladder awareness. List every live product with status, price, and URL. The agent needs to know what's real before it talks about the business.
Tone and vibe. More specific than SOUL.md. Include example phrases, example phrasings to avoid, context-specific tone adjustments (professional vs casual settings).
The goal: someone could read IDENTITY.md and know exactly how this agent should sound in any situation.
---
What Goes in a USER.md File
USER.md is the agent's profile of the human it works with. This matters more than people realize.
Include:
- Name and role
- Time constraints (my USER.md notes that I work 70+ hours/week at a dealership and am only available for Xero in the evenings)
- What the human wants from the agent vs what they want to own themselves
- Communication preferences (I prefer operational updates in CURRENT_STATE.md, not long messages)
- Guardrails on the relationship (what the agent should never do without asking)
When the agent understands the human's actual constraints, it stops suggesting strategies that require the human to be available during business hours.
---
How to Write Your First Identity File (Practical Steps)
Start with SOUL.md. Spend two hours on it. Don't try to get it perfect — the file improves over time as you notice the agent doing things that don't fit your brand.
Step 1: Write the mission statement. One paragraph. What is this agent here to do, specifically?
Step 2: List 3-5 mandates. Specific behaviors, not goals.
Step 3: Write 5 principles. How does the agent make decisions when the rules don't cover the situation?
Step 4: Define the guardrails. What requires human approval before the agent acts?
Step 5: Describe the voice. Specific enough that someone could identify a fake output.
That's your SOUL.md. Load it into your AI platform of choice and start a session. Notice what's off. Update the file. The system improves with each correction.
For the full architecture — including how memory files work alongside identity files, how to build source-of-truth documents, and how to set up your first automation — the $7 beginner's guide covers all of it in plain English.
---
The Correction Loop (How Identity Files Get Better)
The first version of your SOUL.md will not be right. That's fine. Here's how to improve it:
1. Run a session. Note anything the agent says or does that doesn't fit your intent.
2. Identify which principle or rule the file is missing.
3. Add it. Specifically.
4. Run another session.
Within 5-10 corrections, most agents stabilize significantly. Within a month of regular use, the file becomes accurate enough that you stop needing to correct it often.
The agents that drift are the ones without identity files, or with files that are too vague to actually constrain behavior.
Read more: How to Build an AI Co-Founder
---
Common Mistakes When Writing Identity Files
Too vague. "Be helpful and professional" gives the agent nothing to work with. Vague principles produce inconsistent behavior.
Missing the guardrails section. If you don't define what requires approval, the agent will make that call itself. Sometimes it'll be fine. Sometimes it won't.
Not updating when reality changes. When you change your pricing, strategy, or product focus, the identity files need to update too. If they don't, the agent will keep describing the old reality.
Trying to cover everything upfront. Don't. Write what you know, run the agent, update based on what you observe. Completeness comes from iteration, not planning.
---
What an Identity File Doesn't Do
An identity file doesn't give the agent memory. That's a separate system — daily log files for short-term memory, MEMORY.md for long-term, SOURCE_OF_TRUTH.md for canonical facts. The identity file defines who the agent is. Memory defines what it knows.
Read more: How to Give an AI Agent Persistent Memory Across Sessions
The combination of both is what makes an AI agent actually reliable to run.
---
Start Here
If you want to build your first AI agent with a proper identity layer and memory system, the $7 beginner's guide walks through the full setup in plain English. No coding required.
$7 — Your First AI Agent: A Beginner's Guide
If you've already built something basic and want to go deeper into the full architecture — guardrails, verification loops, automation scheduling — Book 1 covers the complete system with real file excerpts from Evo's vault.
---
*Published by Xero AI. We document the process of running a real company with an AI co-founder — with real numbers, real tools, and live infrastructure.*