Already have a stack
Drop into the gateway, the chain, or the agent.
You do not have to run the proxy. Runelm ships first-class adapters for LiteLLM, LangChain, and the OpenAI Agents SDK. Each one wraps the model in place — same pipeline, same fail-closed guarantee, zero change to the rest of your code.
Drop Runelm into an existing LiteLLM proxy as a CustomGuardrail. Every model behind the gateway is classified and pseudonymized pre-call, then rehydrated post-call — no application code changes.
# litellm proxy_config.yaml
guardrails:
- guardrail_name: runelm
litellm_params:
guardrail: runelm.adapters.litellm.RunelmGuardrail
mode: pre_and_post_call
config_path: ./runelm.yaml
ᚷChat-model wrapper
LangChain
Wrap any BaseChatModel. The protected model is a drop-in for the real one inside a prompt | model | parser chain — classification, pseudonymization, routing, and bounded rehydration wrap every invoke.
from langchain_openai import ChatOpenAI
from runelm.adapters.langchain import RunelmProtectedChatModel
model = RunelmProtectedChatModel(
wrapped=ChatOpenAI(model="gpt-5"),
config_path="runelm.yaml",
session_id="conv-42",
)
chain = prompt | model | parser # chain unchanged
chain.invoke({"question": user_input})
ᚨAgent model
OpenAI Agents SDK
Pass a protected Model into Agent(model=…). Every turn the agent takes is sanitized inline through the same pipeline — audit-first, block, sanitize, call, rehydrate, audit-post.
from agents import Agent, Runner
from runelm.adapters.openai_agents import RunelmProtectedAgentsModel
agent = Agent(
name="analyst",
model=RunelmProtectedAgentsModel(
model="gpt-5",
config_path="runelm.yaml",
),
)
Runner.run_sync(agent, user_input) # each turn sanitized