Skip to content
Go To Dashboard

Credentials and configuration

Credential or valueStored or suppliedVisible after writeUsed by
Studio access tokenRandom per launch; carried in the loopback URL and local requestsPrinted only for CLI launches that do not open the browserProtects one 127.0.0.1 Studio HTTP/WebSocket server
Cached Sapiom sign-inCurrent environment entry in ~/.sapiom/credentials.jsonAccount identity is visible; protect the file because it contains an API keyDesktop Studio, npx Studio, and the local @sapiom/mcp authoring server
Standalone SDK API keyExplicit createClient({ apiKey }) argument or SAPIOM_API_KEYAvailable to that processDirect @sapiom/tools capability calls
Runtime-injected agent keySupplied by Sapiom inside a production runNot returned to agent source or stored in the projectThe production step’s ctx.sapiom client
Agent secretWritten to one cloud agent definitionKey name onlyProduction step processes as process.env[KEY]
Runtime defaultStored separately on one cloud definitionPath and value are readableEntry input for supported future run starts
Caller inputSent by the run initiatorRecorded as effective run inputOne execution

The Studio access token and the Sapiom API key are not interchangeable. sapiom.json contains project identity and resources, never either credential.

  • With a cached credential, Studio reuses it without opening OAuth.
  • With no cache, a normal launch opens signed out.
  • --login starts browser OAuth only when no credential is cached; it does not force a fresh login.
  • --no-auth skips credential file and authentication network access during startup. It does not remove the in-app Connect account action.

The desktop app probes the same cache. On a clean non-test launch, it starts browser authentication before opening its main window. If authentication is cancelled, times out, or is otherwise unavailable, the desktop opens signed out for local work and keeps Connect account available for a later retry.

ToolEffect
sapiom_authenticateOpens browser authentication and writes the current environment’s cache entry.
sapiom_statusReports the selected environment and whether a credential is available.
sapiom_logoutClears the cached credential for the selected environment.

Keep ~/.sapiom/credentials.json private. Studio creates it with owner-only permissions, but backups, shell history, and copied diagnostics can still expose it. Never paste its contents into an issue or prompt.

Create an explicit client:

import { createClient } from "@sapiom/tools";
const sapiom = createClient({ apiKey: process.env.SAPIOM_API_KEY });

Or import a namespace directly after setting SAPIOM_API_KEY:

import { sandboxes } from "@sapiom/tools";
const sandbox = await sandboxes.create({ name: "docs-example" });

Standalone @sapiom/tools code does not automatically read the Studio/authoring-MCP credential cache. Inside a production agent step, prefer the runtime-injected ctx.sapiom client instead of constructing another client or embedding a key.

ActionSapiom sign-in required?Notes
Open/edit a local projectNoCoding-agent authentication is separate and belongs to Claude Code.
Check or Local RunNoLocal Run inherits ordinary host process environment; it does not download cloud secrets.
Browse the live template galleryYesBundled offline starters remain available without Sapiom authentication.
Link, deploy, or Prod RunYesDeploy can use metered cloud build compute; production calls are live.
Inspect, signal, or manage schedulesYesThese operate organization-owned cloud state.
Hosted MCPYesConfigure that remote MCP independently from the local authoring MCP.
Standalone @sapiom/toolsYesSupply an API key explicitly or through SAPIOM_API_KEY.

Secrets are scoped to a cloud definition. The read contract is names-only: GET /v1/workflows/definitions/:id/secrets returns { "keys": [...] }, while writes and deletes return no value. There is no supported read-back path.

  • use a JavaScript environment identifier beginning with a letter or underscore;
  • the dashboard normalizes entry to uppercase A-Z, 0-9, and _;
  • maximum key length is 256 characters;
  • PATH, names beginning SAPIOM_ or WORKFLOWS_, and prototype-related keys are reserved;
  • one definition can configure at most 256 keys;
  • a value can contain up to 16,000 characters.

The dashboard’s .env import preserves each accepted secret value rather than trimming it. Invalid lines can be reported without echoing their value.

At every production step dispatch, the runtime resolves that definition’s configured values and injects them into the step process. An undeclared or unconfigured key is absent. Replacing or deleting a key affects later step dispatches; it does not mutate a process already running.

Server-side reuse copies a value from one owned definition to another. It is not a live reference. Each copy must be rotated or deleted independently.

Runtime defaults are non-secret values stored separately from agent secrets. The read endpoint returns only rows a user explicitly set, including each dotted path, value, and last-update time. An untouched declared default has no stored row.

Supported stored value shapes are:

  • string, including email and cron text;
  • finite number;
  • boolean;
  • flat array of strings.

A path is one or more JavaScript-identifier segments, such as deliverTo or client.email. Objects belong in the path structure, not in the stored value. Prototype-related path segments are rejected.

Saving null or omitting a setting value resets that path by deleting its stored row. false, 0, and a non-empty string are real stored values, not resets.

Supported customer run starts assemble input in this order, with later layers winning:

template defaultInput
→ template settings[].default
→ stored definition values
→ caller input
→ entry-step Zod parse

Stored values are read at run start. They take effect on the next supported run without a deploy and do not modify an execution already started.

Template manifests can declare requiredSecrets, settings, and defaultInput. The current hand-authored defineAgent manifest does not export those declarations. Its entry Zod schema and caller input remain authoritative; do not invent defineAgent properties to configure the dashboard.