What IDFOR controls
One protection layer for every agent action
Connect once, then use agentId to apply the right policy to each supervised agent,
workflow or department.
Overview
Connect the SDK once and let IDFOR review prompts, tool calls, documents, outputs, token usage and spend before any agent action reaches a model or external system.
Access key to governed action
Use one IDFOR key for the police agent and pass an agentId for each supervised agent.
IDFOR applies the right policy before the action continues.
What IDFOR controls
Connect once, then use agentId to apply the right policy to each supervised agent,
workflow or department.
Execution flow
Guard every entry point
Use the same SDK surface to block risky actions before they leave your perimeter.
Control spend early
Estimate cost, enforce budgets, request human approval or block oversized requests in advance.
Keep policy traceability
Publish full policy versions and keep a durable audit trail per agent and decision.
How it works
IDFOR sits between your agents and the systems they use, so every sensitive action can be checked for policy, cost, context and approval before execution.
Sends a prompt, tool call, document or model request with an agentId.
Normalizes metadata, preserves scope and sends the action to IDFOR for review.
Checks restrictions, jurisdiction, tool permissions, context size, cost and approvals.
Only receives approved or degraded payloads, never blocked requests.
Execute immediately and keep evidence attached to the response.
Shrink context, sanitize fields or limit the execution path before continuing.
Queue approval when policy or cost requires a human decision.
Block the action before tokens, credentials or external APIs are consumed.
Core concepts
IDFOR stays model-agnostic: keep your current providers and orchestration layer while adding one control point for policy, spend and evidence.
The API key identifies the police-agent scope that owns global policies, budget limits and audit records.
agentId identifies the supervised agent that actually handles support, legal, coding or RAG tasks.
Rules are published as full YAML revisions with history. You do not patch a single row in place.
Each evaluated action can emit an evidence_id with decision metadata and a stable audit trail.
Escalations can be listed and resolved from the SDK when the correct answer is human approval, not silent blocking.
The safe path is not always binary. IDFOR can shrink context, sanitize fields or lower scope before continuing.
decision and human-readable summaryreasons with the policy basis for the actioneffective_message when the request is sanitized or degradedtoken_usage and estimated cost when token control is enabledevidence_id for downstream logging, approvals and audit reviewInstall
Install the SDK from your IDFOR package links or from an internal package file, then connect it to the agent actions you want to govern.
Remote package
Package file
Quickstart
The fastest adoption path is to place IDFOR in front of a single action. Start with
guardInput or guard_input, inspect the decision, and then move to wrapped model calls.
Wrap model calls
Use guardModelCall or guard_model_call when you want the SDK to supervise the full
interaction: input guard, provider call, output guard, evidence continuity and token accounting.
Execution chain
evidenceId into your provider metadata.Use this when
Tool and document guards
Client agents do not only talk to models. They call tools, send emails, write tickets and ingest files. The same police layer can evaluate those actions with dedicated methods.
Guard tools
send_email, create_ticket or custom tool names.Guard documents
Token & cost guard
Token control is not a cosmetic metric layer. It is a preflight decision system that estimates size, cost and budget risk before the request is sent to a provider.
Safe to execute within token and spend thresholds.
Reduce scope, summarize context, switch model or limit the execution path.
Reject the request before it reaches the provider and consumes tokens.
Escalate to approval when spend crosses a configured high-risk threshold.
Programming cost guard
A short request can still imply repository-wide reads, many file edits, test suites, migrations, CI or Docker changes. The programming cost guard scores that implied scope before an external coding agent burns context and budget.
Policies and agents
Use the SDK to list client agents, create new ones and publish policy versions without leaving your integration workflow.
To add or remove rules you publish a new full policy version with
saveAgentPolicy or save_agent_policy. This preserves history and keeps the audit
model clear.
Evidence and approvals
The SDK can return the evidence trail for every evaluated decision and help you resolve escalations when an operation requires human review.
Evidence history
List recent decisions, then load a specific evidence item to inspect what happened and why.
Approval queue
List pending approvals, resolve them and keep the final operator action attached to the record.
Integrations
The SDK sits in front of existing providers and agent workflows. Use the same policy layer to govern prompts, tools, documents, output and spend across OpenAI, Claude, Gemini and custom flows.
“Cost & Guard active” means the current SDK already supports preventive checks for that surface. “Planned” means the connection model is designed, but the packaged provider bridge is not yet exposed in this release.
Reference
The JavaScript and Python clients expose the same conceptual capabilities with idiomatic method names.
| Capability | Node.js | Python | Purpose |
|---|---|---|---|
| Health | health() |
health() |
Check connectivity with the main IDFOR platform. |
| SDK catalog | sdkCatalog() |
sdk_catalog() |
Return package download URLs and installation commands. |
| Prompt guard | guardInput() |
guard_input() |
Evaluate input before a provider or orchestrator is called. |
| Output guard | guardOutput(), filterOutput() |
guard_output(), filter_output() |
Filter a model response before returning it. |
| Tool guard | guardToolCall() |
guard_tool_call() |
Validate outbound tool executions. |
| Model wrapper | guardModelCall() |
guard_model_call() |
Guard input and output inside one wrapped provider call. |
| Document guard | guardDocument() |
guard_document() |
Inspect files before context ingestion. |
| List agents | listAgents() |
list_agents() |
List client agents accessible from the police agent scope. |
| Create agent | createAgent() |
create_agent() |
Create a new client agent under the workspace. |
| Publish policy | saveAgentPolicy() |
save_agent_policy() |
Publish a new full YAML version for an agent. |
| Evidence | listEvidence(), getEvidence() |
list_evidence(), get_evidence() |
Browse recent decisions and inspect specific evidence records. |
| Approvals | listApprovals(), resolveApproval() |
list_approvals(), resolve_approval() |
Operate a human-in-the-loop review queue. |
Rollout checklist
Teams usually adopt the SDK incrementally. Start with one path, validate the evidence and then expand coverage to the rest of your agents.
agentId for every guarded action.Downloads
This documentation links directly to the hosted SDK artifacts and to the main application entry point. Use these URLs in onboarding guides, internal portals or deployment runbooks.
Node.js package
Python package
Platform