Custom Agents

Custom Agents

Custom agents are applications and workflows you build directly — using LLM APIs, agent frameworks (LangGraph, CrewAI, AWS Strands), or your own orchestration code. Highflame offers two integration patterns for these, which can be used independently or combined.

SDK — Inline guardrails

Embed guardrails directly in your application code at the points where sensitive operations happen: before a prompt reaches a model, before a tool executes, before a response is returned. This gives you explicit, per-step control and works with any framework.

Choose this when you want to:

  • Guard specific steps in an agent lifecycle rather than proxying all traffic

  • Use typed SDK abstractions and decorator-style protection (@shield.prompt, @shield.tool)

  • Integrate with LangGraph, CrewAI, AWS Strands, or a custom agent loop

  • Keep enforcement decisions close to the code path where actions happen

from highflame import Highflame, Shield, BlockedError

client = Highflame(api_key="hf_sk_...")
shield = Shield(client)

@shield.prompt(mode="enforce")
def chat(message: str) -> str:
    return openai.chat.completions.create(
        model="openai/gpt-4o-mini",
        messages=[{"role": "user", "content": message}],
    ).choices[0].message.content

See Integration Examples for SDK patterns in Python and TypeScript, including tool call guards, response evaluation, and framework integrations.


Agent Gateway — Centralized proxy

Route your LLM and MCP traffic through the Highflame Agent Gateway. Point your existing OpenAI-compatible client at Highflame instead of the upstream provider. Guardrails, observability, and governance apply automatically to every request — no changes to individual call sites required.

Choose this when you want to:

  • Secure multiple agents or applications through a shared control point

  • Apply consistent policy across teams and environments without rewriting clients

  • Govern MCP tool and server access centrally

  • Route traffic across multiple providers (openai/gpt-4o, anthropic/claude-sonnet-4-6, azure/...) through a single endpoint

See Integration Examples for Gateway examples across OpenAI, TypeScript, Azure, Bedrock, and the Responses API.

For full Gateway documentation: Multi-Protocol Gateway, Securing Model Calls, Securing MCPs.

Last updated