Skip to main content
Use this page when you are wiring sec0-sdk/instrumentation into application classes and want a direct mapping between decorators and app.hops entries.

Supported decorated hop types

The hop key comes from ClassName.methodName, and the type in sec0.config.yaml must match the decorator used on that method.
Use this decoratorapp.hops typeMinimum config fieldsUse it when
@sec0.agent()agentnodeId, agentName, agentVersionThe method is an agent execution point
@sec0.orchestrator()orchestratornodeId, orchestratorName, orchestratorVersionThe method is an orchestrator execution point
@sec0.gateway()gatewaynodeId, gateway, gatewayBaseUrlThe method is a gateway entrypoint
@sec0.server()servernodeId, serverThe method is a tool server handler
@sec0.middleware()middlewarenodeId, middleware, opThe method is a middleware enforcement boundary
@sec0.tool()toolnodeId, server, toolThe method is a concrete tool invocation
@sec0.skill()skillnodeId, skillThe method is a skill execution boundary

Example app.hops entries

app:
  hops:
    OrderAgent.run:
      type: agent
      nodeId: order-agent
      agentName: order-agent
      agentVersion: "1.0.0"
    Workflow.orchestrate:
      type: orchestrator
      nodeId: workflow-orch
      orchestratorName: workflow-orch
      orchestratorVersion: "1.0.0"
    EdgeGateway.forward:
      type: gateway
      nodeId: edge-gateway
      gateway: edge-gateway
      gatewayBaseUrl: "https://gateway.internal.example.com"
    OrdersServer.invoke:
      type: server
      nodeId: orders-server
      server: orders
    OrdersMiddleware.enforce:
      type: middleware
      nodeId: orders-middleware
      middleware: orders-middleware@1.0
      op: invoke@1.0
    OrdersTool.lookupOrder:
      type: tool
      nodeId: orders-tool
      server: orders
      tool: lookupOrder@1.0
    PricingSkill.run:
      type: skill
      nodeId: pricing-skill
      skill: price-lookup

Matching decorated methods

import { initializeSec0App, sec0, AgentManager } from "sec0-sdk/instrumentation";

initializeSec0App("./sec0.config.yaml");

class OrderAgent {
  @sec0.agent()
  async run(ctx: any, input: { orderId: string }, manager: AgentManager) {
    manager.agent.setState({ order_id: input.orderId });
    manager.agent.setMetadata({ received_at: Date.now() });
    return { ok: true };
  }
}

class Workflow {
  @sec0.orchestrator()
  async orchestrate(ctx: any, input: any, manager: AgentManager) {
    manager.agent.objective("Plan and execute the workflow safely.");
    return { ok: true };
  }
}

class EdgeGateway {
  @sec0.gateway()
  async forward() {}
}

class OrdersServer {
  @sec0.server()
  async invoke() {}
}

class OrdersMiddleware {
  @sec0.middleware()
  async enforce() {}
}

class OrdersTool {
  @sec0.tool()
  async lookupOrder() {}
}

class PricingSkill {
  @sec0.skill()
  async run() {}
}
If you need to build a fully custom boundary instead of using decorators, use Middleware for custom adapter wiring, Network Gateway for direct gateway pipeline usage, and Agent State for manual state propagation.