Deploy an OpenAI agent with handoffs and guardrails
The OpenAI Agents SDK provides a lightweight framework for building agents with tool use, handoffs between agents, and input/output guardrails.
Copy
from agents import Agent, Runneragent = Agent( name="assistant", instructions="You are a helpful assistant.",)while True: try: user_input = input() except EOFError: break result = Runner.run_sync(agent, user_input) print(result.final_output)
Copy
openai-agents
Copy
superserve deploy agent.py # or agent.tssuperserve secrets set my-agent OPENAI_API_KEY=sk-...superserve run my-agent
Runner.run_sync blocks until the full response is ready. For token-by-token streaming, use Runner.run_streamed instead - see the OpenAI Agents SDK streaming docs.