Agent Tool Policy Filter
agent.tool_policy_filter
Overview
Applies only the allowlists, denylists, tag requirements, scope allowance and cost, latency or side-effect ceilings you provide. Surviving tools keep input order. The skill reads no task text, computes no relevance score, recommends nothing, does not consult Squillify entitlements, and does not authorise execution. Every reported exclusion names the exact policy rule that caused it.
Prompt assembly often needs a small, auditable policy gate before tools are shown to a model. The mechanical filter makes that step reproducible without pretending to understand which tool is relevant.
Reliability
Deterministic and input-order preserving. Every exclusion comes from one published rule; no semantic score or recommendation exists. FILTER_METADATA_INVALID means toolMetadata is empty, malformed or contains an undeclared field — correct the named entry and retry. FILTER_KEY_DUPLICATE means two entries share a key — de-duplicate the catalog and retry. FILTER_CONSTRAINTS_INVALID means a rule name or value is unsupported — correct the named constraint and retry. FILTER_LIMIT_EXCEEDED means toolMetadata exceeds 5000 entries or limit is outside 1 to 1000 — split the catalog or choose a valid limit.
Context footprint
Returns keys and compact policy reasons, never descriptive metadata. A successful call costs 1 execution credit.
When to use it
When the caller already has tool metadata and explicit admissibility rules.
When the caller needs relevance ranking, authorization or entitlement lookup.
Scope
Non-goals
- Does not rank, score, route or recommend tools
- Does not read task text or infer caller intent
- Does not consult the live catalog, tenant entitlements, quota or authorization
- Does not execute any tool
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 |
|---|---|---|---|
| toolMetadata | array | Yes | Unique tool metadata records in caller order. The skill refuses more than 5,000 records with FILTER_LIMIT_EXCEEDED. |
| constraints | object | No | Closed optional mechanical allowlist, denylist, tag, scope and ceiling policy; omit it to apply none. |
| limit | integer | No | Output bound; omit it for 1,000. The skill refuses a limit above 1,000 with FILTER_LIMIT_EXCEEDED. |
| includeExcluded | boolean | No | Whether excluded decisions are returned; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| tools | array | Yes | Included tools in caller order, 0 through the limit, each a closed key with optional category and cost. |
| reasons | array | Yes | Bounded policy decisions, 0 through the report cap, each a closed key, decision, reasonCode and optional ruleId. |
| summary | object | Yes | Closed bounded filtering summary with candidate, included and excluded counts, applied constraints and truncation. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"agent.tool_policy_filter","input":{"toolMetadata":[{"key":"text.clean","sideEffect":"NONE"}],"constraints":{"maxSideEffect":"NONE"}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("agent.tool_policy_filter", {"toolMetadata":[{"key":"mail.send_summary","requiredScopes":["mail:send"],"sideEffect":"EXTERNAL_WRITE"},{"key":"text.build_summary","requiredScopes":["skills:invoke"],"sideEffect":"NONE"}],"constraints":{"allowedScopes":["skills:invoke"],"maxSideEffect":"NONE"},"includeExcluded":true});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. |
| FILTER_METADATA_INVALID | 400 | No | The request payload failed this skill's input validation. |
| FILTER_KEY_DUPLICATE | 400 | No | The request payload failed this skill's input validation. |
| FILTER_CONSTRAINTS_INVALID | 400 | No | The request payload failed this skill's input validation. |
| FILTER_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not rank, score, route or recommend tools
- Does not read task text or infer caller intent
- Does not consult the live catalog, tenant entitlements, quota or authorization
- Does not execute any tool
- Choosing the most relevant tool for a task
- Authorising execution
- Discovering the tenant's entitled catalog
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "agent.tool_policy_filter",
"input": {
"toolMetadata": [
{
"key": "mail.send_summary",
"requiredScopes": [
"mail:send"
],
"sideEffect": "EXTERNAL_WRITE"
},
{
"key": "text.build_summary",
"requiredScopes": [
"skills:invoke"
],
"sideEffect": "NONE"
}
],
"constraints": {
"allowedScopes": [
"skills:invoke"
],
"maxSideEffect": "NONE"
},
"includeExcluded": true
}
}Examples
A scope and side-effect policy excludes the mail writer
{
"toolMetadata": [
{
"key": "mail.send_summary",
"requiredScopes": [
"mail:send"
],
"sideEffect": "EXTERNAL_WRITE"
},
{
"key": "text.build_summary",
"requiredScopes": [
"skills:invoke"
],
"sideEffect": "NONE"
}
],
"constraints": {
"allowedScopes": [
"skills:invoke"
],
"maxSideEffect": "NONE"
},
"includeExcluded": true
}{
"tools": [
{
"key": "text.build_summary"
}
],
"summary": {
"excludedCount": 1,
"includedCount": 1,
"truncated": false,
"constraintsApplied": [
"allowedScopes",
"maxSideEffect"
],
"candidateCount": 2
},
"reasons": [
{
"decision": "INCLUDED",
"key": "text.build_summary",
"reasonCode": "POLICY_ALLOWED"
},
{
"decision": "EXCLUDED_BY_POLICY",
"key": "mail.send_summary",
"ruleId": "constraints.allowedScopes",
"reasonCode": "SCOPE_NOT_ALLOWED"
}
]
}With no policy, tools remain in caller input order
{
"toolMetadata": [
{
"category": "text",
"key": "z.last"
},
{
"category": "text",
"key": "a.first"
}
]
}{
"tools": [
{
"category": "text",
"key": "z.last"
},
{
"category": "text",
"key": "a.first"
}
],
"summary": {
"excludedCount": 0,
"includedCount": 2,
"truncated": false,
"constraintsApplied": [],
"candidateCount": 2
},
"reasons": [
{
"decision": "INCLUDED",
"key": "z.last",
"reasonCode": "POLICY_ALLOWED"
},
{
"decision": "INCLUDED",
"key": "a.first",
"reasonCode": "POLICY_ALLOWED"
}
]
}Recommended use cases
- Remove tools whose required scopes are outside an allowed set
- Apply side-effect, latency or cost ceilings before constructing a prompt
- Explain which explicit policy rule excluded a supplied tool
Avoid for
- Choosing the most relevant tool for a task
- Authorising execution
- Discovering the tenant's entitled catalog
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.