> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sec0.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Decorated Hops Reference

> Decorator-to-hop mapping for configuring sec0-sdk/instrumentation.

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 decorator     | `app.hops` `type` | Minimum config fields                               | Use it when                                     |
| ---------------------- | ----------------- | --------------------------------------------------- | ----------------------------------------------- |
| `@sec0.agent()`        | `agent`           | `nodeId`, `agentName`, `agentVersion`               | The method is an agent execution point          |
| `@sec0.orchestrator()` | `orchestrator`    | `nodeId`, `orchestratorName`, `orchestratorVersion` | The method is an orchestrator execution point   |
| `@sec0.gateway()`      | `gateway`         | `nodeId`, `gateway`, `gatewayBaseUrl`               | The method is a gateway entrypoint              |
| `@sec0.server()`       | `server`          | `nodeId`, `server`                                  | The method is a tool server handler             |
| `@sec0.middleware()`   | `middleware`      | `nodeId`, `middleware`, `op`                        | The method is a middleware enforcement boundary |
| `@sec0.tool()`         | `tool`            | `nodeId`, `server`, `tool`                          | The method is a concrete tool invocation        |
| `@sec0.skill()`        | `skill`           | `nodeId`, `skill`                                   | The method is a skill execution boundary        |

## Example `app.hops` entries

```yaml theme={null}
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

```typescript theme={null}
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](/docs/middleware) for custom adapter wiring, [Network Gateway](/docs/gateway) for direct gateway pipeline usage, and [Agent State](/docs/agent-state) for manual state propagation.
