Implementation Guide

Applying one tool-call policy to OpenAI function calling and Anthropic tool use

Write the policy once, against a provider-neutral representation of a tool call. Convert each provider's tool-call output into that representation, evaluate it at a single enforcement point before any tool executes, and write one audit record format for every decision. Then test that identical calls from both providers produce identical decisions and records.

Where the two formats differ and why it matters for policy

OpenAI function calling and Anthropic tool use each return a requested tool call in their own format. A policy written against one format has to be rewritten for the other, and controls end up split across provider integrations.

The remedy is to keep the policy out of the provider-specific layer entirely, so that the same rule set applies whichever model produced the call.

Define the policy as a provider-independent control

Write the policy once, against a provider-neutral representation of a tool call. Evaluate it at a single enforcement point before any tool executes. Each call receives one of three decisions, based on one rule set: allow, deny, or require approval.

Calls that need a human decision are held, and the record names who decided. The policy is versioned, so every audit record can state which version produced its decision.

Map both formats to a common policy input and audit record

Convert each provider's tool-call output into the common representation, then write one audit record format for every decision. The path below is the same for a call from either provider.

  1. Model outputOpenAI or Anthropic returns a requested tool call in its own format.
  2. NormalizerMaps each format to one common policy input.
  3. Policy decisionAllow, deny, or require approval, based on one rule set.
  4. Tool executionRuns only after a decision permits it.
  5. Audit recordSame fields for every call, regardless of provider.

What stays neutral and what depends on the provider

Only the edges of the system know about providers. Everything between them operates on the common representation.

Depends on the provider

  • Ingress adapters, one per provider
  • Egress adapters, which convert results or denials into each provider's result format
  • Provider metadata in the audit record

Stays neutral

  • The policy and its version
  • The policy engine and its decisions
  • The approval handler
  • The executor
  • The audit record fields

Place the enforcement point between model output and tool execution

The enforcement layer has five components, listed here in the order a call passes through them.

  1. Ingress adapters

    One per provider. They only parse and normalize, and contain no policy logic.

  2. Policy engine

    Evaluates the normalized call against the versioned policy and returns a decision.

  3. Approval handler

    Holds calls that need a human decision and records who decided.

  4. Executor

    Runs permitted tools and accepts no calls from outside the enforcement layer.

  5. Egress adapters

    Convert results or denials back into each provider's result format.

Verify consistent allow, deny, and audit behavior

Test that identical calls from both providers produce identical decisions and records. Each of the following should hold.

  • An allowed call from either provider produces the same decision and the same audit fields, apart from provider metadata.
  • A tool missing from an agent's allowlist is denied from both providers, and the denial is logged.
  • Arguments that violate a constraint, and malformed arguments, are denied identically in both formats.
  • A call above the approval threshold is held, and the audit record names the approver and outcome.
  • Every record includes the policy version, and replaying a call against that version reproduces the decision.
  • No tool can be reached except through the enforcement layer, confirmed by attempting direct invocation.

Review where enforcement sits in your agent architecture

If your tool-call controls are split across provider integrations, a runtime enforcement layer can bring them under one policy. Talk through your architecture with our team.

Talk to an Expert