Modules & Files
A module is one policy file.- Must start with a package
- Optional imports
- Then one or more rules
Rules
Value Rules (with if/else bodies)
- Branching with else
- Each block is a query of literals
Default Rules
- Sets a fallback value if no other rule branch applies
Function Rules
- Rules can take arguments, like functions
Set & Object Rules
Comprehension Rules
Expressions & Queries
Literals
- Expressions, not exprs
someexistential,everyuniversal
Assignments & Comparisons
Arithmetic & Boolean
References & Calls
With Modifiers
Collections & Scalars
Arrays, Objects, Sets
Scalars & Variables
Quantifiers
some/every
Negation
not
Membership
in
Builtins (Supported Categories)
Aggregates
Arrays
Sets
Objects
Strings
Numbers
Time
Conversions & Encoding
Regex
Semver
Newton Crypto Extensions
Newton extends the standard Rego runtime with custom cryptographic builtins for signature recovery. These are available in the Newton Regorus engine used by operators and thenewton-cli regorus eval command.
newton.crypto.ecdsa_recover_signer
Recovers the signer address from a raw message hash and ECDSA signature.
| Parameter | Type | Description |
|---|---|---|
signature | string | Hex-encoded ECDSA signature (65 bytes with recovery id) |
message_hash | string | Hex-encoded 32-byte message hash |
newton.crypto.ecdsa_recover_signer_personal
Recovers the signer address from a personal message and ECDSA signature. Applies the EIP-191 \x19Ethereum Signed Message:\n prefix before recovery.
| Parameter | Type | Description |
|---|---|---|
signature | string | Hex-encoded ECDSA signature (65 bytes with recovery id) |
message | string | The original message string (prefix is applied automatically) |
Example
Not Yet Supported
- Standard Crypto / Tokens / JWT:
crypto.*,jwtverify*,jwtencode*— use Newton crypto extensions instead - HTTP:
http.send— not implemented (use PolicyData WASM oracles for external data) - GraphQL:
graphql.*— not implemented - Glob matching:
regex.globs_match— not implemented - JSON Patch:
json.patch— not implemented - Networking:
net.*— not implemented - AWS Providers:
providers.aws.*— not implemented - Rego Meta:
rego.metadata.*,rego.parse_module— not implemented - Template rendering:
strings.render_template— not implemented