ZLAR Gate ยท Open Source ยท Apache 2.0

ZLAR Gate

One gate. Your rules. Every agent framework.

Policy enforcement for AI coding agents. Works with Claude Code, Cursor, and Windsurf. Same policy, same audit trail, same human authority โ€” across every editor.

Get Started โ†’ Read the Legal
3
Frameworks supported
1
Policy file
Ed25519
Signed policy
Fail-closed
If it breaks, it stops

The Problem

Three editors. Three ungoverned surfaces.

AI coding agents run with your permissions across every editor. You turned off the safety prompts because they were annoying. Now your agent can delete files, push code, install packages, and make network requests โ€” in Claude Code, in Cursor, in Windsurf โ€” with no gate between intent and execution.

Every editor has its own bypass. None of them have a policy layer. You're managing risk three times, inconsistently, or not at all.

ZLAR Gate creates one gate for all of them.


Architecture

One engine. Three adapters.

ZLAR Gate has a core gate engine and framework-specific adapters. The adapters are thin translators โ€” ~80 lines each โ€” that sit between each framework's hook protocol and the gate's native format. The engine does all the work: classification, policy matching, Telegram approval, audit trail.

Claude Code

PreToolUse hook. All 10 tools. JSON stdout response. Fail-closed โ€” no response means deny.

Cursor

beforeShellExecution, beforeReadFile, beforeMCPExecution. JSON permission response. File edits audited post-write.

Windsurf

pre_run_command, pre_write_code, pre_read_code, pre_mcp_tool_use. Exit code response. Post-execution events audited.

FrameworkHook EventsResponse Format
Claude CodePreToolUse (10 tools)JSON stdout
CursorbeforeShellExecution, beforeReadFile, beforeMCPExecutionJSON permission
Windsurfpre_run_command, pre_write_code, pre_read_code, pre_mcp_tool_useExit code

Policy

Write once. Govern everywhere.

Write your rules once. Sign them with Ed25519. Every framework evaluates against the same policy. One audit trail captures decisions from all editors. One Telegram bot handles all approval requests.

AI writes code. Humans write rules.

{
  "rules": [
    {
      "domain": "bash",
      "detail": { "regex": "^(ls|pwd|cat|head|tail)\\b" },
      "action": "allow",
      "description": "Safe read-only commands"
    },
    {
      "domain": "bash",
      "detail": { "contains": "rm " },
      "action": "ask",
      "description": "Deletion requires approval"
    },
    { "domain": "bash", "action": "deny" }
  ],
  "defaultAction": "deny"
}

No machine learning. No inference. Deterministic string matching against human-authored rules. The gate refuses to start with a tampered policy.


Security

Security hardened.


Quick Start

One command.

git clone https://github.com/ZLAR-AI/ZLAR-Gate.git
cd ZLAR-Gate
./scripts/zlar-setup.sh

The setup script checks prerequisites, copies config templates, walks you through Telegram configuration, generates your Ed25519 keypair, signs the default policy, and configures hooks in each framework. See the README for full setup details.


Known Limitations

What ZLAR Gate doesn't do.

In the interest of transparency:

Cursor file edits are audited, not pre-blocked. Cursor's afterFileEdit hook fires after the edit is applied. Shell commands and MCP calls are fully gated. File edits are recorded in the audit trail but cannot be stopped in advance.

Obfuscated commands may not be caught. Policy rules use regex matching. Variable indirection, base64 encoding, and eval wrappers can bypass string-level rules. This is a fundamental limitation of any regex-based classifier.

Adapter accuracy depends on framework hook contracts. When Claude Code, Cursor, or Windsurf updates their hook protocols, adapters may need updating. ZLAR Inc. makes no guarantee of compatibility with future framework versions.

ZLAR Gate reduces risk. It does not eliminate it. See Legal for complete terms.


The ZLAR Family

Seven products. One thesis.

Same principle: independent governance that does not depend on the model's cooperation. Different surfaces.

ProductPlatformWhat it does
ZLAR-OCmacOS (OpenClaw)OS-level containment โ€” user isolation, kernel sandbox, firewall, signed policy, audit trail
ZLAR-CCClaude CodeHook-based gate โ€” tool-call interception, risk classification, signed policy, Telegram approval
ZLAR GateClaude Code + Cursor + WindsurfUniversal policy enforcement โ€” one gate, three frameworks
ZLAR-LTClaude Code + Cursor + WindsurfZero-config governance โ€” one command install, deny-heavy defaults
ZLAR-AUZLAR Gate audit trailCompliance reporting โ€” PCI-DSS, SOC 2, OSFI B-13, SOX, EU AI Act
ZLAR-NTCross-platformNetwork egress policy โ€” domain-aware, gate-integrated
ZLAR-FLCross-platformFleet governance โ€” registry, health monitoring, audit aggregation

Built by Vincent Nijjar and ZLAR Inc.
Open source under Apache License 2.0. Free to use, modify, and distribute.