Workspace agents
Give OpenClaw and Hermes Agent a persistent filesystem with a hard spend cap per end user, MCP access and signed file-change webhooks.
Use an approved installed mountable mcp, or the npm examples below with
lifecycle scripts disabled. Report setup blockers; do not use sudo or a remote
shell installer. Follow the agent trust boundary.
OpenClaw and Hermes Agent use the existing mountable.io MCP server,
npx -y --ignore-scripts mountable-cli mcp. These adapters do not change the CLI. The host
process holds MOUNTABLE_API_KEY. create_mount_ticket returns a ticket and
mount_command convenience hint for a person. Agents validate the fields and
construct the documented mount command with an approved path and the ticket
on stdin; never evaluate that returned string.
Mounting stays a local process; see MCP and
Agents.
For an app serving several end users, your backend creates a capped filesystem for each user before either agent runs. It prepares task files through the SDK, registers a webhook, and gives the agent access to that same filesystem through MCP. Storage and downloads are billed; disconnecting an agent does not delete its stored files.
Create a capped filesystem per user
Provision once with a management key
(MOUNTABLE_MANAGEMENT_KEY) and a saved payment method, and give the
backend's API key (MOUNTABLE_API_KEY, not limited to one filesystem) access
to the new filesystem. Keep both keys in your backend. MOUNTABLE_API_KEY_ID holds the
API key's ID, api_key.id from GET /api/v1/me called with that key. The CLI reads only
MOUNTABLE_API_KEY, so its provisioning lines set it to the management key.
With curl, set ORG_ID to your organisation ID from GET /api/v1/me; the
CLI and the SDKs find it themselves:
FS_ID=$(MOUNTABLE_API_KEY="$MOUNTABLE_MANAGEMENT_KEY" mountable fs create user-42 \
--spending-cap-cents 500 --mutations-per-minute 60 \
--byte-quota 1073741824 --entry-quota 10000)
MOUNTABLE_API_KEY="$MOUNTABLE_MANAGEMENT_KEY" mountable grants set "$FS_ID" api_key "$MOUNTABLE_API_KEY_ID" rwimport os
from mountable_sdk import Mountable
with Mountable(api_key=os.environ["MOUNTABLE_MANAGEMENT_KEY"]) as admin:
user_fs = admin.create_filesystem(
"user-42", spending_cap_cents=500, mutations_per_minute=60,
byte_quota=1024**3, entry_quota=10_000,
)
admin.set_grant(user_fs.id, "api_key", os.environ["MOUNTABLE_API_KEY_ID"], "rw")import { Mountable } from "mountable-sdk";
const admin = new Mountable({ apiKey: process.env.MOUNTABLE_MANAGEMENT_KEY });
const userFs = await admin.createFilesystem("user-42", {
spendingCapCents: 500,
mutationsPerMinute: 60,
byteQuota: 1024 ** 3,
entryQuota: 10_000,
});
await admin.setGrant(userFs.id, "api_key", process.env.MOUNTABLE_API_KEY_ID!, "rw");admin() { printf 'header = "Authorization: Bearer %s"\n' "$MOUNTABLE_MANAGEMENT_KEY"; }
FS_ID=$(admin | curl -q --fail-with-body -sS --config - -X POST \
"https://mountable.io/api/v1/orgs/$ORG_ID/filesystems" \
-H "Content-Type: application/json" \
-d '{"name":"user-42","spending_cap_cents":500,
"mutations_per_minute":60,"byte_quota":1073741824,"entry_quota":10000}' | jq -er .id)
admin | curl -q --fail-with-body -sS --config - -X PUT \
"https://mountable.io/api/v1/orgs/$ORG_ID/filesystems/$FS_ID/grants" \
-H "Content-Type: application/json" \
-d '{"principal_type":"api_key","principal_id":"'"$MOUNTABLE_API_KEY_ID"'","mode":"rw"}'The limits take effect in the create request: 500 cents per UTC calendar
month ($5 or €5 in your organisation's billing currency), 60 changes per
minute, 1 GiB and 10,000 entries. The organisation's cap still applies.
Save the returned id as FS_ID against your authenticated end user and
reuse it for SDK calls, MCP tickets and webhook registration. Creating a
filesystem is not idempotent: after a timeout, list filesystems and inspect
the result before trying again.
The backend chooses the user-to-filesystem mapping and limits. Do not let
model arguments select another user's filesystem or raise a cap. For each
user's agent, configure a separate MCP server instance with an API key
limited to that filesystem; the worker cannot
raise its own limits. The management key creates it
(MOUNTABLE_API_KEY="$MOUNTABLE_MANAGEMENT_KEY" mountable api-keys create worker-42 --filesystem "$FS_ID",
or create_api_key(..., filesystem_id=...) / createApiKey(..., { filesystemId })), or an owner or admin
creates it on the console's API keys page; API keys cannot create other keys.
Choose a lifetime of up to 365 days and replace the key before it expires.
In the OpenClaw and Hermes configuration below,
MOUNTABLE_API_KEY is this limited worker key, not the provisioning key.
The backend snippets use their own MOUNTABLE_API_KEY, separate from the
MCP worker process. The bundled skills also support standalone use; in your
app, direct the agent to reuse its assigned FS_ID.
To change limits later, the backend updates only the changed limits with the
management key (mountable fs update, update_filesystem /
updateFilesystem, or PATCH).
See limits per end user for ranges, reserved usage
and errors. The MCP adapters do not set these limits.
Prepare task files
The CLI's files commands and the SDKs read and write the same files the
agent mounts, without needing FUSE on your backend. Install the SDK with
pip install mountable-sdk (Python 3.10 or newer) or
npm install mountable-sdk. Set FS_ID from the stored user mapping and use
a backend key with a grant on that filesystem.
printf 'Write a short report to result.md.' | mountable files write "$FS_ID" task.md
# Dispatch the agent, wait for completion, then:
# mountable files read "$FS_ID" result.mdimport os
from mountable_sdk import Mountable
with Mountable(base_url="https://mountable.io") as client:
fs = client.filesystem(os.environ["FS_ID"], mode="rw")
fs.write("task.md", "Write a short report to result.md.")
# Dispatch the agent, wait for completion, then read through this same handle:
# report = fs.read("result.md").data.decode("utf-8")import { Mountable } from "mountable-sdk";
const client = new Mountable({ baseUrl: "https://mountable.io" });
const fs = client.filesystem(process.env.FS_ID!, "rw");
await fs.write("task.md", "Write a short report to result.md.");
// Dispatch the agent, wait for completion, then read through this same handle:
// const report = new TextDecoder().decode((await fs.read("result.md")).data);# MOUNTABLE_TOKEN from a token session, as in /docs/files-api#authentication
printf 'Write a short report to result.md.' > task.md
printf 'header = "Authorization: Bearer %s"\n' "$MOUNTABLE_TOKEN" |
curl -q --fail-with-body -sS --config - \
--upload-file task.md "https://mountable.io/api/v1/filesystems/$FS_ID/files/task.md"Mount that filesystem at /mnt/mountable and the agent sees
/mnt/mountable/task.md. Reuse one SDK handle for the job so calls share
a token session. A reviewer can use a separate "ro" handle or read-only
mount. Over HTTP, ask for one token session
for the job and reuse it. See SDKs for conditional writes and following changes.
On 402 filesystem_spending_cap_reached, stop that user's billable work;
other users' filesystems keep working. 402 spending_cap_reached means
the organisation cap was reached. For 429 rate_limited, wait
retry_after seconds in Python or retryAfter in TypeScript. A write
timeout has an unknown outcome: read back before retrying, or use a
conditional write.
Receive signed file changes
Start a public HTTPS receiver on port 443, then register it once for the
same FS_ID, using the backend key with read-write access to that
filesystem, before dispatching the agent:
HOOK_JSON=$(mktemp) # holds the id and the one-time secret
mountable webhooks create "$FS_ID" https://your-app.example/hooks/mountable --json > "$HOOK_JSON"from mountable_sdk import Mountable
with Mountable() as client:
hook = client.create_webhook(fs_id, "https://your-app.example/hooks/mountable")import { Mountable } from "mountable-sdk";
const hook = await new Mountable().createWebhook(fsId, "https://your-app.example/hooks/mountable");HOOK_JSON=$(mktemp) # holds the id and the one-time secret
printf 'header = "Authorization: Bearer %s"\n' "$MOUNTABLE_API_KEY" |
curl -q --fail-with-body -sS --config - -X POST --output "$HOOK_JSON" \
"https://mountable.io/api/v1/orgs/$ORG_ID/filesystems/$FS_ID/webhooks" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-app.example/hooks/mountable","path_prefix":"/"}'A webhook delivers only while the key that registered it is valid. If that
key expires or is revoked, the webhook shows
disabled_reason: access_revoked. When replacing the key, register a new
webhook with the new key, store its new secret, and delete the old webhook.
Store the returned webhook id and one-time secret in your backend
secret store. Never log the response or send it to the agent. Until they
are stored, the receiver should return 503 so the initial
files.resync delivery can be retried. Webhooks are not billed.
The existing
workspace.py helper
checks the signature, a five-minute timestamp window, the filesystem ID and
the webhook ID. Copy that file into your backend (it uses httpx, installed
with the Python SDK). In your HTTP handler:
from workspace import verify_webhook
# hook is the registration loaded from your backend's secret store.
# raw_body is the untouched request bytes; request_headers is the header mapping.
message = verify_webhook(
hook["secret"], request_headers, raw_body,
filesystem_id=fs_id, webhook_id=hook["id"],
)
# On ValueError, reject with 400/401 without processing.
# Otherwise durably enqueue message, then answer 2xx within 10 seconds.Here fs_id comes from the same stored mapping as FS_ID. Your app
supplies the HTTP server, durable queue and cursor storage. Apply a message
only if int(message["data"]["cursor"]) exceeds the last applied cursor
for this webhook, and store that cursor with the result.
A files.changed message includes data.events[]: each path has a
created, updated or deleted type and its current file value.
Renames produce a deletion for the old path and a creation for the new one.
Mount writes can produce several events; reconcile current state rather
than counting events as completed jobs. For files.resync, list every
page of the files you track with the SDK, queue messages arriving during
the listing, then apply them by cursor. Authenticate and acknowledge
unknown event types without triggering work. See webhooks
for signature examples in Python and TypeScript, retries and secret rotation.
Hand the workspace to the agent
Use the assigned filesystem with create_mount_ticket, a new
idempotency_key for each mount, and mode: "ro" for a reviewer.
filesystem_usage reports usage; your backend decides whether to change
limits. If a ticket response has no ticket, do not mount: follow the
retry rules.
Only the one-time ticket and mount instructions go to the sandbox. Keep
the API key, webhook secret and provisioning calls on the host/backend.
When the job finishes, unmount cleanly and call revoke_mount_session
with the session ID. Revocation stops new operations within 15 seconds.
The following adapters connect the agent to these MCP tools.
OpenClaw
Add the server to ~/.openclaw/openclaw.json. The value
${MOUNTABLE_API_KEY} is taken from the environment OpenClaw runs in. Do not
paste the key into the file.
{
"mcp": {
"servers": {
"mountable": {
"command": "npx",
"args": ["-y", "--ignore-scripts", "mountable-cli", "mcp"],
"env": { "MOUNTABLE_API_KEY": "${MOUNTABLE_API_KEY}" }
}
}
}
}The same block is
/integrations/openclaw/mcp-server.json.
From the CLI, keep the placeholder in single quotes so the shell does not
write the key into openclaw.json. OpenClaw substitutes ${MOUNTABLE_API_KEY}
from the environment it runs in. The stdio child does not inherit that
variable on its own.
openclaw mcp add mountable \
--command npx \
--arg -y \
--arg=--ignore-scripts \
--arg mountable-cli \
--arg mcp \
--env 'MOUNTABLE_API_KEY=${MOUNTABLE_API_KEY}'
openclaw mcp doctor mountable --probeCopy
/integrations/openclaw/skills/mountable/SKILL.md
to <workspace>/skills/mountable/SKILL.md. That directory is the workspace
skill root OpenClaw loads first.
Hermes Agent
Copy
/integrations/hermes-agent/skills/mountable/SKILL.md
to ~/.hermes/skills/mountable/SKILL.md. Hermes lists it as a local skill.
Store the key in ~/.hermes/.env, then add a native server named
mountable in ~/.hermes/config.yaml. Hermes expands
${MOUNTABLE_API_KEY} from that file when it starts the server:
mcp_servers:
mountable:
command: npx
args: ["-y", "--ignore-scripts", "mountable-cli", "mcp"]
env:
MOUNTABLE_API_KEY: "${MOUNTABLE_API_KEY}"Check the connection before starting a job:
hermes mcp test mountableIt should report Connected and the tools it discovered. The real key
stays only in ~/.hermes/.env; the config above keeps the
${MOUNTABLE_API_KEY} placeholder. Do not paste the key into a skill
or a prompt.
The sandbox still needs the mountable CLI and Linux FUSE (/dev/fuse).
Give it the ticket only:
mkdir -p /mnt/mountable && printf '%s\n' "$MOUNTABLE_TICKET" | mountable mount --ticket-stdin --json /mnt/mountable &Leave the mount process running and wait for the JSON event mounted
before using the files. Unmount with mountable unmount /mnt/mountable
when the job finishes, then revoke the session from the host.