Skip to content

AgentApp

sectr.AgentApp is the one object your project exposes: [agent] entry in sectr.toml names it as module:attribute, and Sectr imports your module to find it. Serving the agent shows it in use.

  • name — the project slug. It should match [app] name in sectr.toml.
  • env — the names of the secrets the agent needs (see secrets).

Serves handler on path. With a framework, the handler is the adapter’s: openai_agents(agent), langgraph(graph) or pydantic_ai(agent) (see the adapter reference).

The decorator form, for a handler of your own: see no framework.

Paths must start with / and be unique in the project: Sectr directs sessions by (project, path). Registering a bad or duplicate path raises ValueError.