Evaluate ABAC
identity.evaluate_abac
Overview
You pass subject, action, resource, environment, and a constrained attribute-based access policy; we evaluate it deterministically and return allow or deny, matched rule ids, and a per-rule trace. Expressions use eq/neq/in/contains/comparisons with and/or/not — no code execution or reflection. We fail closed: unknown operators, excessive depth, or missing attributes deny. Do not use this as a full XACML/Rego engine or for storing policies.
An attribute policy that lives inside your application code is impossible to audit and easy to get subtly wrong. Here the grammar is small enough to read, the evaluation is the same every time, and you get back the rule-by-rule trace that explains the verdict.
Reliability
Same attributes and same policy, same decision — we execute no code, follow no reference outside the objects you send, and touch no clock or network. We fail closed, and that always arrives as a normal success carrying decision "deny", an empty matchedRules, and a one-entry evaluationTrace under ruleId "__policy__" whose effect text says why. That happens when a rule has an effect other than allow or deny, when a condition is not an object or has no string op, when the operator is unknown, when and or or has an empty conditions array, when in or not_in gets a non-array value, when a numeric comparison gets a non-number, when nesting passes 20 levels, when there are more than 1,000 rules, or when a referenced attribute is absent and the comparison did not set allowMissing. So a single typo in one rule denies the whole request rather than half-applying your policy: read the "__policy__" trace entry, fix the rule it names, and call again. A policy with no rules array at all also denies, using deny_overrides and a deny default. Bad top-level input — a missing or non-object subject, resource, environment or policy, a missing or non-string action, or a combiningAlgorithm or defaultDecision outside the accepted values — is rejected as invalid input instead, and retrying the same payload will not help.
Context footprint
Returns decision, matchedRules, and evaluationTrace in one auditable pass. A successful call costs 1 execution credit.
When to use it
When access depends on attributes of the caller, the resource or the request, and you can express the rules with the supported operators.
When a plain role check would do, or when you need obligations, functions or the rest of a full policy language.
Scope
Non-goals
- No arbitrary code execution or reflection
- No dynamic traversal outside the objects you provide
- No obligations or advice beyond allow/deny
- Not a full XACML, Rego, or CEL engine
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| subject | object | Yes | Purpose-bound JSON object of caller, resource, or environment attributes reached by dotted paths; extra keys are the attributes and values are scalars, nested objects, or arrays — unconstrained RFC 8259 JSON items. |
| action | string | Yes | Operation being attempted, referenced from conditions as the bare path action. |
| resource | object | Yes | Purpose-bound JSON object of caller, resource, or environment attributes reached by dotted paths; extra keys are the attributes and values are scalars, nested objects, or arrays — unconstrained RFC 8259 JSON items. |
| environment | object | Yes | Purpose-bound JSON object of caller, resource, or environment attributes reached by dotted paths; extra keys are the attributes and values are scalars, nested objects, or arrays — unconstrained RFC 8259 JSON items. |
| policy | object | Yes | Closed ABAC policy with up to 1,000 rules, a combining algorithm, and a default decision used when nothing matches. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| decision | string | Yes | Fail-closed verdict, always exactly allow or deny. |
| matchedRules | array | Yes | Ids of rules whose condition came out true, in policy order, empty when nothing matched or the policy fell closed. |
| evaluationTrace | array | Yes | One object per evaluated rule in policy order, or a single __policy__ row when evaluation fell closed. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"identity.evaluate_abac","input":{"subject":{"id":"u1"},"action":"read","resource":{"ownerId":"u1"},"environment":{},"policy":{"rules":[{"id":"own","effect":"allow","condition":{"op":"eq","attribute":"resource.ownerId","value":"u1"}}]}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("identity.evaluate_abac", {"resource":{"ownerId":"u1"},"policy":{"rules":[{"effect":"allow","id":"own","condition":{"attribute":"resource.ownerId","op":"eq","value":"u1"}}]},"subject":{"id":"u1"},"action":"read","environment":{}});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- No arbitrary code execution or reflection
- No dynamic traversal outside the objects you provide
- No obligations or advice beyond allow/deny
- Not a full XACML, Rego, or CEL engine
- Simple role-only checks (use identity.evaluate_rbac)
- Storing or versioning policies
- Executing unrestricted expression languages
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "identity.evaluate_abac",
"input": {
"resource": {
"ownerId": "u1"
},
"policy": {
"rules": [
{
"effect": "allow",
"id": "own",
"condition": {
"attribute": "resource.ownerId",
"op": "eq",
"value": "u1"
}
}
]
},
"subject": {
"id": "u1"
},
"action": "read",
"environment": {}
}
}Examples
Owner may read their own resource
{
"resource": {
"ownerId": "u1"
},
"policy": {
"rules": [
{
"effect": "allow",
"id": "own",
"condition": {
"attribute": "resource.ownerId",
"op": "eq",
"value": "u1"
}
}
]
},
"subject": {
"id": "u1"
},
"action": "read",
"environment": {}
}{
"decision": "allow",
"matchedRules": [
"own"
],
"evaluationTrace": [
{
"ruleId": "own",
"applicable": true,
"effect": "allow"
}
]
}deny_overrides beats a matching allow rule
{
"resource": {
"ownerId": "u1"
},
"policy": {
"combiningAlgorithm": "deny_overrides",
"rules": [
{
"effect": "allow",
"id": "allow-owner",
"condition": {
"attribute": "resource.ownerId",
"op": "eq",
"value": "u1"
}
},
{
"effect": "deny",
"id": "deny-read",
"condition": {
"attribute": "action",
"op": "eq",
"value": "read"
}
}
]
},
"subject": {
"id": "u1"
},
"action": "read",
"environment": {}
}{
"decision": "deny",
"matchedRules": [
"allow-owner",
"deny-read"
],
"evaluationTrace": [
{
"ruleId": "allow-owner",
"applicable": true,
"effect": "allow"
},
{
"ruleId": "deny-read",
"applicable": true,
"effect": "deny"
}
]
}Recommended use cases
- Attribute-based access checks with an auditable trace
- Preview policy outcomes before enforcing them in your app
- Combine allow and deny rules with explicit combining algorithms
Avoid for
- Simple role-only checks (use identity.evaluate_rbac)
- Storing or versioning policies
- Executing unrestricted expression languages
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.