The complete technical specification for the Universal Event Model's EventID format. Formal grammar, semantic rules, validation requirements, and reference implementations.
Every event in the Universal Event Model is identified by a structured EventID that follows a strict format. This format is designed to be human-readable, machine-parseable, and self-documenting.
The system or bounded context where the event originates.
auth payments agent
The specific object or resource the event relates to.
user order code
What happened - the specific state change or activity.
login charged generated
Schema version for backward compatibility.
1 2 3
The EventID format follows a strict grammar defined in Extended Backus-Naur Form (EBNF). All parsers and validators must implement this grammar exactly.
For quick validation, use this regex pattern:
Beyond syntactic validity, EventIDs must follow semantic rules to ensure consistency and usability across systems.
All identifiers (domain, entity, action) must be lowercase. No uppercase letters are permitted.
auth.user.login:1
Identifiers must begin with a lowercase letter (a-z), not a number or underscore.
user2 not 2user
Version must be a positive integer (1 or greater). Zero and negative numbers are invalid.
:1 :42 not :0
Version numbers cannot have leading zeros. Use 1 not 01.
:1 not :01
Underscores can be used within identifiers to separate words, but not at the start.
user_account not _user
All four components are required. Empty strings are not permitted for any part.
a.b.c:1 minimum
| Component | Allowed Characters | First Character | Length |
|---|---|---|---|
| Domain | a-z 0-9 _ |
a-z |
1+ characters |
| Entity | a-z 0-9 _ |
a-z |
1+ characters |
| Action | a-z 0-9 _ |
a-z |
1+ characters |
| Version | 0-9 |
1-9 |
1+ digits |
Reference examples for valid and invalid EventIDs to guide implementation and testing.
Real-world scenarios that require careful consideration when designing event schemas.
When an action involves a sub-entity (like billing for an account), should you nest the structure or keep it flat?
Distinguishing between state changes and discrete actions on the same entity.
When to increment the version number versus creating a new event type.
Standard patterns for AI-generated code and agent activity events.
agent domain for all AI-generated activity. This makes it trivial to query, audit, and analyze all AI behavior in your system.
Production-ready implementations for common platforms. All implementations follow the specification exactly.
Full implementation available at rust-example/ - includes emit! macro, Event struct, and async EventCollector.
JSON Schema for automated validation and code generation. Use this as the source of truth for building parsers and validators.
Use the specification to make your AI-generated code observable, verifiable, and improvable.