New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

What is Policy Versioning?

3 min read Updated

Policy versioning is the practice of tracking changes to policy documents over time using version control (git), enabling audit trails of who changed what and when, rollbacks to previous versions, and code review workflows for policy changes.

WHY IT MATTERS

A policy that was correct last week might not be correct today. New tools are added, agent scopes change, compliance requirements evolve, and incidents reveal gaps. Policies must change — but uncontrolled changes to security policies are themselves a security risk. A misconfigured policy could expose sensitive data or block legitimate operations. An unauthorised change could weaken controls without anyone noticing.

Policy versioning solves this by applying the same rigour to policy changes that software engineering applies to code changes. Every modification is a commit with an author, timestamp, and message explaining why the change was made. Every version is preserved, so you can see exactly what the policy looked like at any point in history. Differences between versions are visible as diffs, making review straightforward.

For compliance, policy versioning is essential. Auditors need to know not just what your current policies are, but what they were during the audit period. If a security incident occurred on a specific date, you need to know which version of the policy was active at that time. Git provides this history automatically — every commit is a snapshot that can be reconstructed.

Versioning also enables safe experimentation. Teams can branch, test policy changes against real traffic patterns, and merge only after validation — reducing the risk that a well-intentioned change creates a new vulnerability.

Policy Versioning isn't theory — define it as policy in PolicyLayer and it's enforced on every tool call.

ENFORCE THIS WITH POLICY →

Enforced before the call runs. Nothing to install.

HOW POLICYLAYER USES THIS

In PolicyLayer, a policy is a single JSON document attached to a grant, edited in the dashboard's visual policy builder and validated against the schema on save. The Raw JSON view exposes the exact document, so teams that want git-based review export it to a repository — every change goes through a pull request, gets reviewed by a security or platform team member, and is pasted back into the Raw JSON view only after approval. Because the document attached to the grant is the version the gateway enforces, the dashboard always shows the active policy, and the git history serves as a complete audit trail of every change, who made it, and when.

FREQUENTLY ASKED QUESTIONS

Should policies live in the same repository as application code?
It depends on your organisation. The enforced policy lives in the dashboard, so the repository holds exported JSON copies used for review. A dedicated policy repository gives the security team control over access and review processes. Co-locating with application code makes it easier for developers to propose policy changes alongside feature work. Many organisations use a dedicated repo with cross-team review requirements.
How do I track which policy version is active in production?
The policy attached to a grant is the version the gateway enforces — the dashboard always shows the active document. Open the Raw JSON view to see exactly what is in force, and compare it against the exported copy at the head of your policy repository. If the two match, your repo reflects production.
What if a policy change breaks things?
Restore the previous version of the document — paste the earlier JSON into the Raw JSON view and save. Validation runs on save, so a known-good version takes effect immediately. This is one of the key benefits of policy versioning — recovery is fast and well-understood.

FURTHER READING

// THE REGISTRY

Every MCP server your agents touch has a registry record.

Type a name, get the breakdown: verified identity, auth posture, risk grade, every tool classified, recommended policy. Re-checked continuously.

Teams ship this data inside their own products. See what a licence covers →

Take your agents live. Without losing control.

Route your MCP traffic through PolicyLayer. Every tool call is checked against your policy before it runs: allow, deny, or require approval. Per-identity grants. Full audit log. Live in minutes.

Instant setup, no code required.

46,500+ MCP servers and 515,000+ tools scanned and risk-classified.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.