OpenAI Agents SDK
Integrate AgentSuite with the OpenAI Agents SDK via the Virtue Gateway for full protection: MCP Guard, AgentGuard, and Access Control — with full session tracing and observability in the dashboard.
Installation
pip install agentsuite-sdk[openai]
How It Works
adapter.mcp_server()— proxy MCP server to pass intoAgent(mcp_servers=[...]).adapter.input_filter— register asRunConfig(call_model_input_filter=...)to track user messages each turn.
Quickstart
from agents import Agent, Runner, RunConfig
from agentsuite import GatewayClient
client = GatewayClient(url="...", api_key="sk-vai-...")
adapter = client.openai()
mcp_server = adapter.mcp_server()
await mcp_server.connect()
try:
agent = Agent(
name="my-agent",
model="gpt-4o",
mcp_servers=[mcp_server],
)
run_config = RunConfig(
model="gpt-4o",
call_model_input_filter=adapter.input_filter,
)
result = await Runner.run(agent, input="What are my open tickets?", run_config=run_config)
print(result.final_output)
finally:
await mcp_server.cleanup()
Full runnable example: demo_openai.py
Example Output
The agent responds to the query and prints the session ID:

View the full session trace in the VirtueAgent dashboard (Observability → Sessions):

Environment Variables
| Variable | Description |
|---|---|
VIRTUE_GATEWAY_URL | Gateway MCP endpoint URL |
VIRTUE_API_KEY | VirtueAI API key |
OPENAI_API_KEY | OpenAI API key |
AGENT_MODEL | Model name (default: gpt-4o) |