⚡ Setup guide

Connect your AI agent
to TrustLoop

Pick your environment below. You'll have governance, audit trail, and kill-switch running in under 5 minutes.

Get API key
2
Choose your stack
3
Follow setup steps
4
Verify in dashboard
Step 1 — What are you building with?
🤖
Custom GPT
OpenAI Enterprise
🔶
Claude / MCP
Anthropic
🦜
LangChain
Python
👥
CrewAI
Python
⚙️
OpenAI API
Function calling
🐍
Custom Python
Any framework
🟩
Node.js
Any framework
🔧
No-code
n8n / Make / Zapier
👆

Select your environment above

We'll show you the exact steps for your stack.

🤖
OpenAI Custom GPT
Add TrustLoop as a GPT Action — no code, just configuration. Works with any Custom GPT in your OpenAI Enterprise workspace.
⏱ ~3 min
1
Add TrustLoop as a GPT Action
Open your Custom GPT editor and import the TrustLoop schema.
  1. Open chat.openai.com → My GPTs → Edit your GPT
  2. Click Configure → scroll to ActionsAdd actions
  3. Click Import from URL and paste this URL:
url
https://trustloop.live/openapi.json
OpenAI will fetch and parse the schema automatically. You'll see TrustLoop's endpoints listed.
2
Add your API key
Authenticate TrustLoop so it knows which account to log calls to.
  1. In the Actions panel → Authentication → select API Key
  2. Auth type: Custom
  3. Header name: x-api-key
  4. Paste your TrustLoop API key (starts with tl_)
3
Add the system prompt
This tells your GPT to check with TrustLoop before taking any sensitive action.

Copy this and paste it at the top of your GPT's system instructions:

system prompt
Before taking any sensitive action — sending emails, accessing
databases, calling external APIs, transferring data, or modifying
files — call the TrustLoop interceptToolCall action first.

Pass the action name as tool_name, all relevant parameters as
arguments, and set agent_name to this GPT's name.

Rules:
- allowed: true → proceed.
- allowed: false, status BLOCKED → do NOT proceed.
  Tell the user: "This action was blocked by your organisation's
  AI governance policy: [message]"
- allowed: false, status PENDING → do NOT proceed.
  Tell the user: "This action requires human approval. Your
  administrator has been notified."

Ready to test?

Ask your GPT to do something sensitive. Check your dashboard — the call should appear within seconds.

Open Dashboard →
🔶
Claude Desktop / Anthropic MCP
TrustLoop is a native MCP server. Every tool call Claude makes passes through TrustLoop automatically — no code changes needed.
⏱ ~2 min
1
Get your MCP URL
Your unique TrustLoop MCP endpoint — includes your API key.
url
https://api.trustloop.live/sse?api_key=tl_your_key_here
Replace tl_your_key_here with your actual API key from app.trustloop.live
2
Add to Claude Desktop config
Edit your claude_desktop_config.json file.

File location: ~/Library/Application Support/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "trustloop": {
      "url": "https://api.trustloop.live/sse?api_key=tl_your_key_here"
    }
  }
}
Restart Claude Desktop after saving the config file for the MCP server to connect.
3
For Claude API / Cline / Cursor
Add the MCP server URL to your client's MCP configuration.
python — via SDK
from trustloop import TrustLoop

# Get your MCP URL programmatically
url = TrustLoop.mcp_url("tl_your_key_here")
# → "https://api.trustloop.live/sse?api_key=tl_your_key_here"

Test it

Ask Claude to use a tool. The call will appear in your dashboard audit log immediately.

Open Dashboard →
🦜
LangChain
Wrap all your LangChain tools in one line. Every tool call your agent makes is intercepted automatically.
⏱ ~5 min
1
Install the SDK
Install trustloop-sdk with LangChain support.
bash
pip install trustloop-sdk[langchain]
2
Wrap your tools
One import, one function call — all your tools are governed.
python
from trustloop import TrustLoop
from trustloop.integrations.langchain import wrap_tools

tl = TrustLoop(
    api_key="tl_your_key_here",
    agent_name="my-langchain-agent"
)

# Your existing tools — unchanged
raw_tools = [search_tool, email_tool, db_tool]

# Wrap them — TrustLoop intercepts every call
tools = wrap_tools(raw_tools, tl)

# Pass to your agent as normal
agent = create_openai_tools_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)
Environment variable shortcut: set TRUSTLOOP_API_KEY=tl_... and call TrustLoop() with no arguments.
3
Handle blocked calls (optional)
Catch TrustLoopBlockedError for graceful handling.
python
from trustloop import TrustLoopBlockedError

try:
    result = executor.invoke({"input": user_message})
except TrustLoopBlockedError as e:
    print(f"Blocked by governance: {e}")

Run your agent

Every tool call will appear in your dashboard audit log in real time.

Open Dashboard →
👥
CrewAI
Govern every tool in your crew with a one-line class decorator. Works with any BaseTool.
⏱ ~5 min
1
Install
bash
pip install trustloop-sdk[crewai]
2
Decorate your tools
Add @governed_tool to any CrewAI BaseTool class.
python
from trustloop import TrustLoop
from trustloop.integrations.crewai import governed_tool
from crewai.tools import BaseTool

tl = TrustLoop(api_key="tl_your_key_here", agent_name="my-crew")

@governed_tool(tl)
class SendEmailTool(BaseTool):
    name: str = "send_email"
    description: str = "Send an email"

    def _run(self, to: str, subject: str, body: str) -> str:
        # Only runs if TrustLoop allows it
        ...
Have existing tool instances? Use wrap_crew_tools(tools, tl) to wrap them all at once without changing the class definitions.

Kick off your crew

Tool calls appear in the dashboard as they happen.

Open Dashboard →
⚙️
OpenAI API — Function Calling
Intercept tool calls in your function-calling loop before dispatching each function.
⏱ ~5 min
1
Install
bash
pip install trustloop-sdk openai
2
Add to your tool dispatch loop
Call tl.intercept() before running each function the model requests.
python
from trustloop import TrustLoop
from openai import OpenAI

tl = TrustLoop(api_key="tl_your_key_here", agent_name="my-openai-agent")
client = OpenAI()

# In your tool dispatch loop:
for tool_call in response.choices[0].message.tool_calls:
    fn_name = tool_call.function.name
    fn_args = json.loads(tool_call.function.arguments)

    # Intercept BEFORE executing
    result = tl.intercept(fn_name, fn_args)
    if not result["allowed"]:
        tool_result = f"Action blocked: {result.get('message')}"
    else:
        tool_result = run_tool(fn_name, fn_args)

Run your agent

Every function call will appear in your dashboard.

Open Dashboard →
🐍
Custom Python Agent
Works with any Python agent — AutoGen, Haystack, custom-built, or any framework not listed above.
⏱ ~5 min
1
Install
bash
pip install trustloop-sdk
2
Option A — Use the decorator
Cleanest approach. Add one line above any function that should be governed.
python
from trustloop import TrustLoop

tl = TrustLoop(api_key="tl_your_key_here", agent_name="my-agent")

@tl.guard("send_email")
def send_email(to: str, subject: str, body: str):
    # Only runs if TrustLoop allows it
    ...

@tl.guard()  # uses function name as tool name
def delete_records(table: str, where: dict):
    ...
3
Option B — Manual intercept
More control. Check the result yourself before proceeding.
python
result = tl.intercept("transfer_funds", {
    "amount": 50000,
    "to": "GB29NWBK..."
})

if result["allowed"]:
    run_transfer()
else:
    print(f"Blocked: {result['message']}")

Run your agent

Calls appear in your dashboard within seconds.

Open Dashboard →
🟩
Node.js / TypeScript
Zero-dependency npm package. Works with any Node.js agent — Express, Next.js, Vercel functions, or standalone scripts.
⏱ ~5 min
1
Install
bash
npm install trustloop
2
Add intercept calls
javascript
import TrustLoop from 'trustloop';

const tl = new TrustLoop({
  apiKey: 'tl_your_key_here',
  // or: process.env.TRUSTLOOP_API_KEY
});

// Before any sensitive tool call:
const result = await tl.intercept('send_email', {
  to: 'ceo@bank.com',
  subject: 'Contract'
});

if (!result.allowed) {
  throw new Error(result.message);
}

// Safe to proceed
await sendEmail(...)
3
OpenAI proxy shortcut
Route all OpenAI calls through TrustLoop in one line.
javascript
import OpenAI from 'openai';
import TrustLoop from 'trustloop';

const openai = new OpenAI(
  TrustLoop.openai('sk-your-openai-key', 'tl_your_key_here')
);
// All tool calls are now governed automatically

Run your agent

Calls appear in your dashboard within seconds.

Open Dashboard →
🔧
No-code — n8n / Make / Zapier
Add TrustLoop as an HTTP step in any workflow. No code, no SDK — just an API call.
⏱ ~5 min
1
Add an HTTP request step before any sensitive action
In n8n, Make, or Zapier — add an HTTP node before the step you want to govern.
http config
Method:  POST
URL:     https://api.trustloop.live/api/intercept
Headers:
  x-api-key:     tl_your_key_here
  Content-Type:  application/json
Body:
  {
    "tool_name":  "send_email",
    "arguments": { "to": "{{email}}", "subject": "{{subject}}" },
    "agent_name": "my-workflow"
  }
2
Check the response before continuing
Add a condition step that only continues if allowed is true.
Response to check: {{ $json.allowed }} — if true, continue. If false, stop the workflow and log the message field.
n8n tip: Use an IF node → condition: {{ $json.allowed }} equals true → True branch continues, False branch stops or notifies.

Run your workflow

Every HTTP call appears in your dashboard audit log instantly.

Open Dashboard →