How Opal Solves It
From Prose Policies to Executable Code
OpalScript is a Python-like language purpose-built for access logic. It gives security teams the same infrastructure-as-code discipline that platform engineers use with Terraform — but for access policy. Define approval workflows, JIT rules, SoD constraints, and break-glass procedures as code that's testable, composable, and peer-reviewable. Ship it through Git and CI/CD. And if you don't write code, describe what you need in plain English — Opal's AI assistant or a coding agent like Claude Code generates the OpalScript for you.
Version-controlled policy that ships through Git · AI-assisted authoring for every practitioner · Auditable execution with full event trail

01
OpalScript isn't a configuration toggle or a YAML template. It supports conditional logic, loops, string matching, and composable actions — giving security teams the expressiveness to encode policies that match how access decisions actually work. If you can describe the rule, you can encode it.
Python-like syntax with
if/elif/else,forloops, and boolean logicFull request context API: requester identity, resource type, resource name, access parameters
Built-in actions:
approve,comment,reject,escalate— composable within branching logic

02
Security engineers can write OpalScript by hand — everyone else describes what they need and AI generates it. Opal's built-in AI assistant accepts natural language instructions like "switch from AWS IAM roles to GCP" or "add a manager approval for production databases," making surgical changes while preserving existing structure. No AI-generated code executes without human review.
Built-in AI assistant in the OpalScript editor for iterative, natural-language script modification
Compatible with Claude Code, Opal's MCP server, and other coding agents for richer workflows
Every AI-generated policy goes through the same review, validation, and deployment process as hand-written code

03
Every OpalScript automation runs on a Service User — Opal's programmatic identity primitive — with its own identity, permissions, API keys, and full event trail. Every execution is logged with actor attribution, timestamp, duration, and outcome. Auditors can trace any automated access decision back to the exact script, the exact policy version, and the exact context that produced it.
Impact

Access intelligence
OpalQuery surfaces the access posture that informs what policies to write: SoD conflicts, orphaned accounts, over-provisioned roles, and drift from intended state
AI-powered reviews
Paladin enforces OpalScript policies as a first-class reviewer in the approval chain, resolving routine decisions autonomously and escalating with specific reasoning
Just-in-time access
OpalScript encodes the JIT rules, duration caps, and break-glass procedures that govern time-bound access across your environment
Agent identity governance
OpalScript policies apply equally to human and non-human identities, including AI agents and service accounts





