Skip to main content

HTTP Server

Python, TypeScript, Go, C#, and Java expose host-native agent HTTP servers. Rust provides the shared bind, request, and route policy helpers; the optional ish-server binary is a Control Plane server, not the same agent HTTP adapter. The host servers use the shared Rust policy and expose /health, /run, /stream, /events, and /approvals/* endpoints.

import asyncio
from ish import Agent, OpenAICompatibleModel
from ish.integrations.server import HTTPServer

agent = Agent(
name="api_agent",
model=OpenAICompatibleModel(model="gpt-4o-mini"),
instructions="Serve agent requests over HTTP.",
)

async def main() -> None:
server = HTTPServer(agent=agent, host="127.0.0.1", port=8000, auth_token="dev-token")
await server.serve_forever()

asyncio.run(main())

Deployment notes​

  • Non-loopback binds (0.0.0.0 or external interfaces) require a bearer authentication token — HttpServerPolicy / validate_http_server_bind rejects non-loopback binds when authToken is missing or blank.
  • Put TLS termination and rate limiting at a reverse proxy or API gateway.
  • Set bounded request-body sizes and timeouts. Rust normalizes the request-read timeout to 15 seconds by default and a 100 ms minimum for every SDK adapter. It also defaults approval-webhook delivery to 5 seconds and clamps finite webhook timeouts to 100 ms–30 seconds. Host transports enforce request-read deadlines; transport-specific behavior after a timeout can differ.
  • In C#, AgentHttpServer lives in the optional Ish.Harness.AspNetCore project (sdks/csharp/aspnet/Ish.AspNetCore.csproj) using Kestrel.
  • Validate auth_token handling before public exposure.

Approval webhooks​

All five SDK HTTP servers support an optional approval webhook_url (TypeScript webhookUrl) and public_base_url. Rust builds the canonical approval notification and delivers it with bounded timeout and concurrency. A 202 approval_required response includes resume_url, constructed from the configured public base URL and approval snapshot identifier, so the approval can be resumed through the server API.