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.
AgentApp(*, name, env)
Section titled “AgentApp(*, name, env)”name— the project slug. It should match[app] nameinsectr.toml.env— the names of the secrets the agent needs (see secrets).
app.add_route(path, handler)
Section titled “app.add_route(path, handler)”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).
@app.agent_route(path)
Section titled “@app.agent_route(path)”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.