# Reviewed network operations and outbound connectors

Smart365Guide can expose an owner-reviewed request sequence as a typed capability.
An agent supplies the business inputs once. The existing Capability Network checks
the connected account, published definition, scopes, approval policy and idempotency
key, executes deterministic steps and independently reads the provider's saved result.
There is no model call inside the step executor. The outer agent can still use a model
to interpret a goal and call the capability.

## Build once, execute with account authority

1. Demonstrate the workflow in an application you own or are authorized to integrate.
   Record only the relevant request methods, relative routes and body shapes. Do not
   put cookies, authorization/CSRF values, personal inputs or full HARs in a tool.
2. Supply explicit input schemas and bindings. The recording is a draft; it does not
   establish reusable authorization, safe retries or a correct verifier automatically.
3. Review a fixed tool manifest and an independent read-only result check. Publish
   the capability in Network Console. Keep authentication in a supported customer
   login/delegation flow; do not turn a captured session into shared agent access.
4. Connect the account and grant the required scopes. Use an existing HTTPS REST/MCP
   provider for public APIs, or enroll a customer-owned outbound worker for local APIs.
5. Give the agent a delegated Smart365 Network key in its private runtime. Use
   `execute_capability` through MCP or `/api/v1/network/execute?detail=compact`.
   `verified` plus successful evidence confirms the outcome; approval/uncertainty do not.

The separate Juniper ecommerce pilot records six write-operation shapes and supplies
owner-authored schemas and a read-only saved-order endpoint. It does not demonstrate
automatic conversion of every website, login, MFA challenge or undocumented API.

The [separate API comparison](https://juniper-supply-bench.vercel.app/network-comparison.html)
includes an equivalent direct compiled integration as a baseline. In that small
synthetic test, grouping operations reduced model calls and tokens; the gateway
added controls and latency compared with the same integration running directly.
It did not reduce the number of application API calls. Raw traces and the fixed
experiment protocol are included; results are not a general savings guarantee.

## Customer-owned worker

The gateway continues to reject private-network URLs for direct REST/MCP providers.
An outbound connector solves a different deployment need: it runs in the customer's
environment, polls for authorized work, and calls a **locally reviewed fixed origin**
using that customer's API credential. Agents cannot supply a new URL or headers.

In **Network Console → Connect provider**, choose **Outbound customer connector** and
enter its fixed customer API origin and paste the reviewed GET/POST tool manifest.
The origin is bound into the manifest identity; the gateway never fetches it for
connector providers. Define/publish the capability. Under
**Connected accounts**, authorize its scopes and enroll the worker. The enrollment
token is shown once, expires after thirty days and is not a browser SDK license.
Only an owner can enroll/rotate it. Revoke account access to stop dispatch.

Use the Node connector included in the SDK download's `server-agent` directory:

```sh
cd server-agent
npm install
node connector.mjs --config /absolute/private/connector.json
```

```json
{
  "gateway": "https://www.smart365guide.com",
  "provider": "https://api.customer.example",
  "connectorTokenEnv": "S365_CONNECTOR_TOKEN",
  "providerTokenEnv": "S365_PROVIDER_TOKEN",
  "manifest": { "tools": [] }
}
```

Replace `manifest.tools` with the exact reviewed tools, and supply the two tokens
through the private process environment. The provider token comes from the host's
supported account/delegation flow; the gateway never supplies it to the worker or
model. Both origins require HTTPS, with HTTP allowed only for loopback development.
The gateway binds the customer worker grant; host account identity and role remain
the customer's API responsibility. Changing the worker's host credential requires
operator review and re-enrollment. The gateway cannot independently attest the
identity of an account behind a compromised customer worker.
The worker validates the manifest hash, tool and input schema, refuses redirects,
bounds results to 64 KB and uses the gateway's stable idempotency key.

Jobs are scoped to the connected provider/account, leased once and reauthorized
before dispatch and result acceptance. Expired leases are not automatically
requeued. A lost response may mean a write committed: stop and perform the independent
read before a retry. Every verification attempt creates a fresh read job. Reconnecting
or rotating credentials invalidates prior connection bindings; inspect the original
account rather than blindly starting the business action again.

The current connector uses bounded database polling. It needs an online worker;
no worker or an expired lease produces uncertainty rather than fabricated success.
Queued arguments/results are persisted with the execution. Configure retention and
customer data handling for your deployment; this is not a general-purpose code
sandbox or a guarantee of isolation from a compromised customer worker.

## Pomerado concept and attribution

This workflow follows the build/review/generalize/deterministic-runtime concept
documented by [Pomerado](https://github.com/Pomerado/pomerado), reviewed at its current
MIT-licensed source. No Pomerado implementation code is incorporated here. Its
documentation says the open-source local MCP host primarily runs browser operations;
HTTP operations need a host-supplied transport. We do not claim its npm installation
automatically supplies network recording or our gateway's authorization controls.

Pomerado is not installed as a runtime dependency: its current package requires
Node 24.21+ below 25, while this workspace uses Node 24.19. Our own connector is
implemented independently using the existing Smart365 Capability Network.
