save_profile_layer
[SUPPORT] 0bec79a7 (PROFILE-5) — Validate and persist ONE layer of the hosted_default -> workspace -> user -> project -> session profile contract (see meridian.profile_contract.FIELD_REGISTRY for the full field list and per-field allowed_layers/merge_strategy/narrow_only rules). REPLACES this sco...
This record as markdown: /tools/io-github-ajc3xc-meridian/save-profile-layer.md
What save_profile_layer does on Meridian
AI agents use save_profile_layer to create or update resources in Meridian, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Meridian environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor | string | — | Optional human/session identity recorded on the hosted_default audit ledger (ignored for non-hosted_default scopes, which are not ledgered). |
fields | object | — | This layer's field declarations — replaces whatever is currently stored at this scope. See meridian.profile_contract.FIELD_REGISTRY for the valid field names. |
scope_id | string | Yes | |
provenance | object | — | Non-secret provenance for this layer's declaration (config source, hashes, observed_at, client/server identity). No secrets or machine-local absolute paths. |
scope_type | string | Yes | |
reset_fields | array | — | Field names this layer explicitly resets back to inheriting from a less-specific layer. Replaces this scope's previous reset_fields list. |
override_reason | string | — | Accepted for symmetry with resolve-time override_reason; this tool does not itself gate on it. |
expected_revision | integer | — | Optimistic-concurrency guard — must match the scope's current revision or the write is rejected with STALE_REVISION. Omit for last-write-wins. |
Parameters from the server's own tool schema.
Why save_profile_layer is rated Medium
An AI agent can call save_profile_layer faster than any human can review: one bad instruction and it creates or modifies resources in Meridian by the hundred, each call as confident as the last.
Attacks that exploit this kind of access
The rule that runs save_profile_layer safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Meridian, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For save_profile_layer, this is the rule to start with:
save_profile_layer stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Meridian, apply this rule, and every save_profile_layer call is checked against it from then on.
Questions about save_profile_layer
[SUPPORT] 0bec79a7 (PROFILE-5) — Validate and persist ONE layer of the hosted_default -> workspace -> user -> project -> session profile contract (see meridian.profile_contract.FIELD_REGISTRY for the full field list and per-field allowed_layers/merge_strategy/narrow_only rules). REPLACES this scope's stored fields/reset_fields wholesale (not a merge) — to add one field to an existing layer, pass the full desired field set, not a delta. Rejects deterministically with {error} on an unknown field, a field not allowed at this scope_type, a secret-shaped value, a machine-local absolute path (outside the field's path_allowed_from_layer), an unsafe/destructive shell command (executor_config.test_cmd/deploy_cmd), or a malformed capability_manifest_ref. expected_revision enables optimistic concurrency: omit it for last-write-wins, or pass the revision you last read from get_profile_layer to fail with a structured {error, code: 'STALE_REVISION', current_revision} instead of silently clobbering a concurrent write. override_reason is accepted for forward symmetry with the narrow_only-widen override knob used at resolve time (get_effective_profile) but this tool itself never blocks a write on it — narrow_only/safe_direction enforcement happens at MERGE time, not write time, since a layer may legitimately declare any value for a field it owns. An idempotent no-op resave (identical fields/reset_fields) returns the current row unchanged with no revision bump. Persistent-state disclosure: on hosted Meridian, supplied text and project/session metadata are sent to and stored in Meridian's service; self-hosted deployments keep them in the configured local SQLite/Postgres database. This data is visible in the dashboard/API and later project context or handoffs. Delete individual tasks, notes, or decisions where supported, or delete the project/account using the documented controls. Do not include secrets. It is categorised as a Write tool in the Meridian MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
save_profile_layer accepts 8 parameters: actor, fields, scope_id, provenance, scope_type, reset_fields, override_reason, expected_revision. Required: scope_id, scope_type. The full parameter table on this page comes from the server's own tool schema.
Register the Meridian MCP server in PolicyLayer and add a rule for save_profile_layer: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Meridian. Nothing to install.
save_profile_layer is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the save_profile_layer rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for save_profile_layer. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
save_profile_layer is provided by the Meridian MCP server (@meridianmcp/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Meridian, and thousands of servers like it.
This server
Across the catalogue