Raw LLM Clients

For agents that call a provider's SDK directly, with no framework in between. In Python, govern_client() wraps the client once and hands back the same object — use it exactly as before. TypeScript doesn't have a per-provider wrapper yet, so gate manually with checkPrompt() / checkResponse() around the call.

See Custom Agents first if you haven't installed the SDK or called start() yet.

OpenAI

from netzilo.openai_sdk import govern, govern_client
from openai import OpenAI

govern()
client = govern_client(OpenAI())

resp = client.chat.completions.create(
    model="gpt-4o", messages=[{"role": "user", "content": "..."}]
)

Anthropic

from netzilo.anthropic_sdk import govern, govern_client
from anthropic import Anthropic

govern()
client = govern_client(Anthropic())

resp = client.messages.create(
    model="claude-sonnet-4-6", max_tokens=1024,
    messages=[{"role": "user", "content": "..."}],
)

AWS Bedrock

from netzilo.bedrock import govern, govern_client
import boto3

govern()
client = govern_client(boto3.client("bedrock-runtime"))

resp = client.converse(
    modelId="anthropic.claude-sonnet-4-6-v1:0",
    messages=[{"role": "user", "content": [{"text": "..."}]}],
)

Native Bedrock requests are signed with AWS SigV4. The embedded SDK re-signs a redacted request with the agent's own AWS credentials, so redactions apply here. The Netzilo client on a device cannot re-sign: it inspects these requests and can block them, but does not redact them.

Google Gemini

from netzilo.gemini import govern, govern_client
from google import genai

govern()
client = govern_client(genai.Client())

resp = client.models.generate_content(model="gemini-2.5-flash", contents="...")

Mistral

from netzilo.mistral import govern, govern_client
from mistralai import Mistral

govern()
client = govern_client(Mistral(api_key="..."))

resp = client.chat.complete(
    model="mistral-large-latest", messages=[{"role": "user", "content": "..."}]
)

Use the AI Gateway instead

Instead of wrapping each client, you can point the OpenAI or Anthropic client at the AI Gateway: base URL <gateway>/v1 for OpenAI-compatible clients or <gateway>/anthropic for the Anthropic SDK, with a Netzilo token sent as a bearer token (api_key for the OpenAI SDK, auth_token for the Anthropic SDK). The gateway then applies the user's model grants, limits and guardrails, including on streamed answers.