# AgentOfMe Gateway Operations

Use this workflow to protect one cloud-hosted OpenClaw or Agent management entrypoint.

## Product model

- An Ingress is one Organization-owned protection boundary.
- One Ingress maps to one domain and one local upstream port.
- An Ingress consumes Organization quota. Plans, orders, and subscriptions belong to the Organization.
- A Gateway is the enrolled machine identity that creates and runs Ingress runtimes.
- AgentOfMe is not a tunnel, NAT traversal service, or traffic relay.

## Canonical workflow

1. Check the host:

   ~~~bash
   agentofme doctor agent openclaw --baseline
   agentofme ingress preflight
   ~~~

2. Enroll the Gateway if it is not already enrolled:

   ~~~bash
   agentofme gateway enroll
   agentofme gateway status
   ~~~

   Gateway enrollment is the only browser authorization step. The human selects the owning Organization.

3. Prepare local configuration if needed, then create Ingress access in the Website:

   ~~~bash
   agentofme ingress new
   agentofme gateway start
   ~~~

   Ingress records are created from the Website using the enrolled Gateway's observed public IP. The Gateway pulls configuration automatically; there is no draft, setup link, claim, trial activation, or per-Ingress checkout.

4. Keep the Gateway running:

   ~~~bash
   agentofme gateway start
   ~~~

5. Inspect or update it:

   ~~~bash
   agentofme ingress status
   agentofme ingress doctor
   agentofme ingress runtime update
   ~~~

## Local state

- Pending configuration: `<data-dir>/.pending/ingress.json`
- Committed runtime: `<data-dir>/<ingress_id>/ingress.json`
- Gateway state: `<data-dir>/gateways/<gateway-id>/`

Successful Website creation plus `gateway start` materializes the Ingress runtime under `<data-dir>/<ingress_id>/ingress.json`.

## Safety rules

- Do not expose arbitrary localhost services or design NAT traversal.
- Keep the protected upstream on loopback when possible.
- Do not print Gateway Credentials, signing secrets, token bodies, or managed upstream commands.
- Never infer ownership from local files; Organization ownership is Platform-authoritative.
- If multiple local Ingresses exist, select one explicitly with `--ingress-id` or intentionally use `--all`.
