Skip to content
Back to BlogEngineering

Building a Multi-Tenant Policy Engine: Lessons from Production

Feb 5, 202612 min read
</>{ }<>fn()0x1F</>{ }<>fn()0x1F
The Policy Engine is the core of what makes AXIOM an enterprise platform rather than a personal tool. Every action the AI takes — sending an email, scheduling a meeting, creating a task, making a phone call — passes through the Policy Engine before execution. The engine evaluates the action against organizational rules written in Rego (Open Policy Agent) and returns one of three verdicts: Allowed, Denied, or Needs Approval. The engineering challenge was scale. Each organization has its own policy set, and policies can be hierarchical: global organizational rules, department-level overrides, and individual employee customizations within organizational boundaries. We needed sub-10ms evaluation times for the common case while supporting complex policy chains that might involve multiple approval workflows. The solution uses a tiered caching strategy with PostgreSQL row-level security ensuring complete data isolation between tenants — even if there is a bug in application code, the database enforces the boundary.
EngineeringView all posts

Ready to replace 9 tools with one?

Free for teams under 5. No credit card required.