Synsemadocsv0.6.xENES

Reference

Capabilities index

Deny-by-default: declare with require capability("scope"). See Capabilities & intent for the model.

capabilities.syn
-- Doc example: deny-by-default capabilities + faithful scope.
-- Uses `secret` because it proves the model with no network/disk side effects.
intent: "doc example: capabilities and intent"
require secret("APP_*")          -- name-prefix scope: covers APP_KEY, APP_DB, ... only

task read_app_key()
    -- APP_KEY is under the declared APP_* scope → allowed (still redacted, as always)
    give text(secret("APP_KEY", "demo")) == "secret(APP_KEY)"

task read_unscoped()
    -- DB_PASSWORD is NOT under APP_* → denied at the capability check (before any use)
    give secret("DB_PASSWORD")

print("APP_KEY is in scope → " + text(read_app_key()))

test "a capability you declared (in scope) is allowed"
    assert(read_app_key())

test "anything outside the declared scope is denied (deny-by-default)"
    assert_error(read_unscoped)
CapabilityGatesScopeAuto-granted in run?
stdoutprint / outputyes
timenow, format_time, sleepyes
llmreason/decide/analyze/generate, llm_step (incl. provider egress)yes
randomrandom, random_int, random_bytes, token, push_vapid_keys (v0.6.15+)no (tokens/nonces)
nethttp*, fetch, ws_connect, push_send (v0.6.15+ — host of the subscription's endpoint: the push service)host: net("api.x"), net(".x"), net("")no
fileread and writepath: file("/data/*")no
file.read / file.writeleast-privilege I/O; file.read also gates watch(path) (v0.6.9+ — watching a tree is reading it)path globno
dbsql/mongo_/redis_path (SQLite) or canonical URLno
secretsecret(...)name: secret("APP_*")no
revealreveal(...)name/label (scoped)no
signsecp256k1_sign / ed25519_sign (blockchain)key secret's name (audited)no
walletcreate custody: mnemonic_ / hd_derive / keystore_source secret's name (audited)no
spendspend(amount, unit, reason) — audited money declaration (spend.log, ceiling SYNSEMA_SPEND_CEILING)unit name or trailing-* prefix: spend("USD")no (never — like sign)
execrun (one-shot) and proc_spawn (live process, v0.6.7+; pty: true v0.6.8+ — no extra capability, a pty grants no OS power a pipe lacks)command nameno
serveserve on Nportno (and required)
envenv(...)name / prefixno
stdinread_line, free-text ask; term_open (v0.6.11+ — the interactive terminal, raw mode)no
memorypersistent state family: remember/recall/forget_memory/memory_summary, add_rule/check_rules/get_rules, create_progress/…/resume_pointdeclared name = the .db identity: memory("agent-name") (ceiling prefix: memory=shop-*)no (writes files; the declaration IS the identity)
sandbox_run (v0.6.14+)run_program(source, opts) — run another Synsema program in a child process under a ceiling ∩ the parent's— (no scope)no

Notes: path scopes are faithful (.. escapes denied; matched case-insensitively on Windows/macOS). sandbox strips everything. A per-task require narrows a task to only what it declares (∩ the program). Under serve/secure mode, even the auto-granted ones must be declared. In --cap-set, none is an empty ceiling (nothing, not even stdout). What the program reads via a template (render/include/layout of a disk file) is gated by file.read too, like read_file — templates baked into a synsema build binary are part of the program and need no capability.