Use this file to discover all available pages before exploring further.
Newton provides Rego built-in functions for checking user identity data within policy evaluation. These functions let you enforce KYC requirements — like age, country, and document status — directly in your Rego policies.Identity built-ins are domain-namespaced under newton.identity.<domain>.*. The KYC domain is the first implemented domain. A generic newton.identity.get(field_name) accessor works across any domain for ad-hoc field access.
For the full Rego syntax reference including all Newton extensions, see the Rego Syntax Guide.
Requires identity_data.address_country_code to be found within the provided list of country codes.Signature:
result := newton.identity.kyc.address_in_countries(country_code_array)
Arguments:
Argument
Type
Description
country_code_array
string[]
Array of 2-letter ISO country codes to check against
Returns:
Type
Description
bool
true if the address country is within the list, otherwise false
Example:
package exampleimport future.keywords.if# Verify the identity data matches address requirementsauthorized if { newton.identity.kyc.address_in_countries(["US","DE","CA"])}
Requires the ISO subdivision location code (combining address_country_code and address_subdivision) to be found within the provided list.Signature:
result := newton.identity.kyc.address_in_subdivision(iso_code_array)
Arguments:
Argument
Type
Description
iso_code_array
string[]
Array of XX-XX or XX-XXX ISO subdivision codes to match against
Returns:
Type
Description
bool
true if the address is within the list, otherwise false
Example:
package exampleimport future.keywords.if# Verify the identity data matches address requirementsauthorized if { newton.identity.kyc.address_in_subdivision(["US-CA","US-OR","US-WA"])}
Requires the ISO subdivision location code to not be found within the provided list. Useful for excluding specific subdivisions while allowing all others in a country (avoids submitting a long allowlist).Signature:
result := newton.identity.kyc.address_not_in_subdivision(iso_code_array)
Arguments:
Argument
Type
Description
iso_code_array
string[]
Array of XX-XX or XX-XXX ISO subdivision codes to exclude
Returns:
Type
Description
bool
true if the address is not in the list, otherwise false
Example:
package exampleimport future.keywords.if# Allow all US users except specific statesauthorized if { newton.identity.kyc.address_in_countries(["US"]) newton.identity.kyc.address_not_in_subdivision(["US-NY","US-NC","US-HI"])}
Works across any identity domain. Returns the raw field value by name. Returns undefined if the field does not exist.Signature:
result := newton.identity.get(field_name)
Arguments:
Argument
Type
Description
field_name
string
The field name to look up
Returns:
Type
Description
any / undefined
The field value, or undefined if the field does not exist
Example:
package exampleimport future.keywords.if# Use generic accessor for ad-hoc field checksauthorized if { newton.identity.get("status") == "approved" newton.identity.get("address_country_code") == "US"}
Address functions (address_in_countries, address_in_subdivision, address_not_in_subdivision) return an error (and the rule evaluates to undefined) when:
Provided an empty array
Provided full country/state names instead of ISO codes
The stored country code or subdivision is empty
Date functions (age_gte, valid_for, issued_since) return an error if given negative numbers or if dates cannot be parsed.
When a built-in function errors, the policy rule containing it evaluates to undefined, which Newton treats as a denial.