Download all docs
data

Encryption Key

A single-purpose element that exposes declarative `encrypt` and `decrypt` ops backed by the platform CDEK key (AES-256-GCM). Flows reference this element to encrypt credentials at rest without embedding crypto primitives in action code.

Working with it

Selecting a Encryption Key reveals its settings in the properties panel; it has no dedicated full-screen workbench.

How it appears

The same element type rendered as a definition, a circle instance, and a live workspace card.

Ek
type

Encryption Key

Declarative encrypt/decrypt ops via the platform CDEK key — unblocks flows that need column-level credential encryption

dataatomdefinition

When to use / not

When to use

  • A flow step needs to store credentials encrypted in a SQL column — wire an encrypt step through this element by slug.
  • A flow step needs to decrypt those credentials before use — wire a decrypt step through this element using the same slug.
  • You want a declarative, auditable encryption surface visible in the element graph and SigNoz span traces.

When not to use

  • Encrypting element specs at rest — handled automatically by platform-encrypted circles via DbSpecLoader.
  • Decrypting legacy pgp_sym_encrypt tokens — use the in-action pgp_sym_decrypt path (IMPROVE-391); this element only covers tokens written by its own encrypt op.
  • Per-user or per-circle keys — use a variable element with sensitive=true (vault-backed).

Topology

Created from the library and placed inside an app or circle. It is a top-level building block you compose with other elements.

Properties

algorithmstring
Encryption algorithm. Only `aes_gcm_256` is implemented; others return NOT_SUPPORTED. Declared for forward-compatibility only.
key_sourcestring
Key source. Only `platform_cdek` is implemented (reads PLATFORM_MASTER_KEY). Others return NOT_SUPPORTED. Declared for forward-compatibility only.

Operations

  • activityGET
  • attachmentsGET
  • batch_statsGET
  • composePOST
  • contextGET
  • costGET
  • createPOST
  • decryptPOST
  • deleteDELETE
  • disablePOST
  • enablePOST
  • encryptPOST
  • export_bundleGET
  • getGET
  • import_bundlePOST
  • intentionGET
  • promotePOST
  • readmeGET
  • readme_updatePOST
  • remove-modifierPOST
  • restorePOST
  • schemaGET
  • sourceGET
  • source_branchesGET
  • source_diff3GET
  • source_fixturesPOST
  • source_mergePOST
  • source_promotePOST
  • source_repairPOST
  • source_statusGET
  • source_validatePOST
  • statsGET
  • treeGET
  • updatePATCH
  • update_metaPATCH
  • versionGET

Composition

Referenced by

Encryption Key (encryption-key)

Category: data | Form: | Symbol: Ek

Declarative encrypt/decrypt ops via the platform CDEK key — unblocks flows that need column-level credential encryption

Single-purpose element exposing encrypt and decrypt ops backed by PlatformKeyService (AES-256-GCM). Flows reference this element by slug to encrypt/decrypt blobs without embedding crypto logic in actions. Uses the platform CDEK key (PLATFORM_MASTER_KEY) by default. Ciphertext format: version(4B)||nonce(12B)||ciphertext — frozen once used.

Capabilities

  • platform-cdek-encrypt: Encrypts arbitrary bytes via the platform CDEK key (AES-256-GCM); output is base64-encoded ciphertext with version+nonce envelope
  • platform-cdek-decrypt: Decrypts ciphertext produced by the encrypt op using the same platform CDEK key; returns UTF-8 plaintext

Properties

PropertyTypeDefaultDescription
algorithmstring"aes_gcm_256"Encryption algorithm. Only aes_gcm_256 is implemented; others return NOT_SUPPORTED. Declared for forward-compatibility only.
key_sourcestring"platform_cdek"Key source. Only platform_cdek is implemented (reads PLATFORM_MASTER_KEY). Others return NOT_SUPPORTED. Declared for forward-compatibility only.

Operations

activity

Get /ops/activity | Auth: Read

Get activity events for this element

Scope depends on element capabilities: individual elements query by element_id, project-form elements with activity-scope-members include member activities, circle-level elements with activity-scope-all query the entire circle. Gracefully returns empty list if activities table is missing (old circles).

attachments

Get /ops/attachments | Auth: Read

List all modifiers and resources attached to this element

Returns both modifiers (policy enforcement) and resources (data injection) with is_modifier flag to distinguish. Items in the generated MODIFIER_TYPES list are modifiers; everything else is a resource. Includes cascade_policy and version pin info.

batch_stats

Get /ops/batch_stats | Auth: Read

Get per-element statistics for this element’s children (circle-wide scope returns only children with run history in the period window)

Returns per-child stats plus an aggregate. Most meaningful on compound or manifest form elements (repositories, circles, projects); atoms have no children so the result is an empty children array with a zeroed aggregate. Uses efficient GROUP BY SQL. Weighted averages for eval scores. Scope is capability-driven (activity-scope-all vs activity-scope-members vs default parent_id) — activity-scope-members holders like automation resolve children via referenced members (ops/reference), not containment (ops/create). Scope caveat: on the circle-wide path (activity-scope-all holders, e.g. the circle root) children are derived from run history, so elements with no runs inside the period window are omitted and totalChildren undercounts full inventory; activity-scope-members and default parent_id scopes zero-fill members with no runs.

compose

Post /ops/compose | Auth: Execute

Batch add and remove modifiers on this element in a single call

Declarative composition: add modifiers by ref path (a bare slug, or a nested slug path such as kind/name) and remove by attachment ID, all in one atomic call on the target element. Each ‘add’ entry resolves the source element, validates topology, attaches with optional priority and cascade policy. Each ‘remove’ entry deletes the attachment row. Returns a summary of what was added and removed. Example: compose({ add: [{ref: “my-prompt”}, {ref: “rate-limit”, priority: 50}], remove: [{attachment_id: “uuid”}] })

context

Get /ops/context | Auth: Read

Get connected elements (graph traversal)

Graph traversal showing all connected elements with their relationship type (contains, contained_by, references, referenced_by, attaches, etc.). Use ?depth=N to control traversal depth (default 1) and ?types=entity,automation to filter by element types.

cost

Get /ops/cost | Auth: Read

Get direct and recursively rolled-up wallet cost for this element

Ledger rows stay owned by the element that incurred them (for inference, the resolved brain). Containers, labs and apps return a deduplicated rollup across containment and explicit element references. Default period is day.

create

Post /ops/create | Auth: Write

Create child element

POST to the parent path — element_type goes in the request body, NOT the URL. Both element_type and slug are required and must be non-empty. Name is derived from slug if omitted. Writes to both Git and PostgreSQL. All elements are stored flat under the circle — no intermediate library wrapper rows. When the parent is a compound whose composition.categories[*].source.kind == 'members', the new element is created at the circle root and wired as a reference (or attachment, for modifiers) into that parent: top-level parent_id stays the circle; the edge name and effective parent element id live in _parent_link.relationship / _parent_link.parent_id.

decrypt

Post /ops/decrypt | Auth: Write

Decrypt base64 ciphertext produced by the encrypt op

Decrypts ciphertext produced by this element’s encrypt op. Input must be the base64-encoded bytes returned by encrypt (version||nonce||ciphertext+auth_tag format). Returns UTF-8 plaintext. Fails with DECRYPTION_FAILED if the ciphertext is tampered, truncated, or was produced with a different key version.

delete

Delete /ops/delete | Auth: Admin

Delete element (soft delete)

Soft delete — sets state to ‘deleted’ but retains the record. Cannot delete elements that have children (has_no_bond precondition) or active runs. Requires admin auth and confirmation.

disable

Post /ops/disable | Auth: Admin

Disable element (hides and prevents use)

Idempotent — safe to call on already-disabled elements. Optionally pass a reason string. Disabled elements cannot be invoked or executed. Inverse of enable.

enable

Post /ops/enable | Auth: Admin

Enable element (makes usable and visible)

Idempotent — safe to call on already-enabled elements. Transitions element to ready/enabled state. Cannot enable deleted elements. Inverse of disable.

encrypt

Post /ops/encrypt | Auth: Write

Encrypt plaintext bytes via the platform CDEK key

Encrypts the provided plaintext using AES-256-GCM with the platform master key (PLATFORM_MASTER_KEY). Returns base64-encoded ciphertext with a version+nonce envelope: version(4B BE)||nonce(12B)||ct+auth_tag. This ciphertext format is frozen — do not change PlatformKeyService’s wire format after tokens have been written with it.

export_bundle

Get /ops/export/bundle | Auth: Read

Export element as downloadable git bundle

On non-root-namespace elements, returns a binary git bundle. On root-namespace (circle) elements, dispatch hands off to the circle’s own export_bundle op, which returns a multi-element JSON envelope with one base64 bundle per child element — this is intentional, not an error.

get

Get /ops/get | Auth: Read

Get element details

Element is already resolved by the routing layer — this returns the cached element, not a fresh DB query. Use the path /api/{circle}/{slug} to address elements.

import_bundle

Post /ops/import/bundle | Auth: Write

Import git bundle into element

Accepts a base64-encoded git bundle in the JSON bundle_base64 field. Use overwrite=true to replace existing elements with same slug (default skips duplicates). Imported elements get new UUIDs. Returns counts of imported/skipped elements and any errors.

intention

Get /ops/intention | Auth: Read

Get element intention with full inheritance chain

Returns three levels: direct (this element’s intention), inherited (from category and root), and resolved (final merged intention). Useful for understanding an element’s purpose in context of its hierarchy.

promote

Post /ops/promote | Auth: Admin

Promote element configuration to a target environment

Only for manifest-form elements (projects). Environments advance: dev → demo → live. dev→demo requires member+ role, demo→live requires admin. Freezes member versions at promotion time (creates snapshot). Persists environment config to spec.environments.

readme

Get /ops/readme | Auth: Read

Get element README.md content

Reads README.md from the element’s git repository. Returns empty content (not an error) if no README exists. Always returns markdown format.

readme_update

Post /ops/readme_update | Auth: Write

Update element README.md content

Creates or overwrites README.md in the element’s git repo. Commits to the draft branch. Content must be provided as a markdown string.

remove-modifier

Post /ops/remove-modifier | Auth: Execute

Remove an attached modifier from this element by attachment ID

Removes a modifier/resource attachment by its row ID. The ID comes from the attachments or context API. This is the reverse of attach — called on the target element, not the source.

restore

Post /ops/restore | Auth: Admin

Restore element to a specific version

Automatically snapshots the current state before restoring (creates a ‘Before restore to vN’ version entry) and records the restored current state as its own version entry (‘Restore to vN’). Writes restored spec to git as .triform/spec.yaml. Git failures warn but don’t fail the operation — DB state is authoritative. Cannot restore deleted elements.

schema

Get /ops/schema | Auth: Read

Get element input/output schema (MCP tools/list compatible)

Returns type-level port schemas from the TypeRegistry — not instance-specific overrides. Includes direction (input/output), required flag, and JSON schema per port. Useful for understanding what data an element accepts and produces.

source

Get /ops/source | Auth: Read

Get any file’s content from the element’s git repository

Reads an arbitrary file from the element’s CAS-backed git tree by its relative path. Same store as readme, just generalized. Path safety: rejects .. traversal, leading /, and null bytes. Use this to view main.py for action elements, asset files for SPAs, etc. Returns empty content (not an error) if the file doesn’t exist. Also returns exists: false so callers can tell that apart from a genuinely empty file.

source_branches

Get /ops/source/branches | Auth: Read

List Source branches for this element

Returns the standard draft/demo/live Source branches, their current commits, and promotion relationships. Use GET /api/{element_path}/ops/source/branches.

source_diff3

Get /ops/source/diff3 | Auth: Read

Preview a three-way merge of two commits without writing

Read-only. Computes what a merge of theirs (default: your base_commit) into ours (default: the draft tip) would produce: per-file conflicts with ours/theirs/base content, plus clean/fast_forward flags. Use after a 409 to see exactly what moved before re-splicing your change. GET /api/{element_path}/ops/source/diff3?theirs={sha}.

source_fixtures

Post /ops/source/fixtures | Auth: Write

Dry-run or apply approved Source seed fixtures

Scans .triform/fixtures/ manifests from the addressed data element Source repo. Defaults to dry_run=true and never imports live runtime data. Apply requires dry_run=false plus confirm=true and dispatches approved records through existing generated element ops.

source_merge

Post /ops/source/merge | Auth: Write

Three-way merge a commit into the draft branch

Merges theirs (default: your base_commit) into the draft branch. Clean (non-overlapping edits) → commits and advances draft, returns merged: true + the new commit. Conflicts → writes nothing and returns the conflict set to resolve and retry. Refused inside an active version-set scope (use version_sets_merge). POST /api/{element_path}/ops/source/merge {“theirs”: “{sha}”}.

source_promote

Post /ops/source/promote | Auth: Write

Promote Source branch forward

Promotes draft to demo or demo to live through the generated element op path. Direct Git pushes to demo/live are blocked by Source policy.

source_repair

Post /ops/source/repair | Auth: Write

Inspect or repair the element Source index

Runs Source repair through the element operation path. Defaults to dry_run=true; set dry_run=false only after reviewing a dry-run report.

source_status

Get /ops/source/status | Auth: Read

Get Source control status for this element

Returns the branch-aware clone URL, checkout commands, current draft commit, child source-link count, portable export summary, Source health, warnings, and auth hints for the addressed element. Use the element-first path: GET /api/{element_path}/ops/source/status.

source_validate

Post /ops/source/validate | Auth: Read

Validate Source branch contents

Validates a Source branch before accepting local Git workflow changes or promotion. Defaults to branch=draft and rejects runtime data, generated output, secret material, and unreadable CAS refs.

stats

Get /ops/stats | Auth: Read

Get aggregate statistics for this element

Health status is computed: error if errorsPerDay > 5 or successRate < 0.8, warning if errorsPerDay > 0 or successRate < 0.95. Firing alerts escalate health to error/warning. Default period is ‘day’. Returns runsPerDay, successRate, avgDurationMs, and more.

tree

Get /ops/tree | Auth: Read

Get the element’s position in the graph — ancestors, children, references, and subtree statistics

Uses per-circle ElementGraph cache for O(1) lookups. Returns ancestors (containment chain), children (direct), members (references), referenced_by (reverse refs over the element-reference graph only — the element_references rows projected from an assembly/project’s spec.members; wire connectivity joins ports via spec.from/spec.to and creates no element reference, so an element that a wire points at does NOT appear here), attachments, and subtree stats. Default depth is 3, max is 10. Pass ?include_metadata=true for name/state on each node.

update

Patch /ops/update | Auth: Write

Update element

Partial update — send only the fields you want to change. spec, name, and intention are all independently optional. spec MUST be a JSON object when present; deep-merged into the existing spec by default. Empty {"spec":{}} preserves existing spec content but still records a new version (no-op for content, not for version state). To clear/replace the entire spec wholesale send {"spec":{...},"deep":false}. List-typed spec fields use replace semantics (the patch list replaces the existing list, no array merging). Coordinates Git + DB writes. Slug cannot be changed after creation.

update_meta

Patch /ops/update_meta | Auth: Write

Update element metadata (lightweight merge — does NOT bump version or snapshot spec)

Shallow JSONB merge into element.meta. Top-level keys in the provided value replace existing meta values; other keys are preserved. Used for UI metadata like canvas positions, panel state, viewer preferences. Wire-shape op_name is update_meta (distinct from update) so SSE subscribers + the cache auto-invalidator can distinguish lightweight metadata changes from spec edits without inspecting the payload. The MutatingElementStore wrapper stamps this op_name on the lifecycle event emitted by update_element_meta storage calls.

version

Get /ops/version | Auth: Read

Get current version or full history

Returns current version by default. Pass ?history=true for full version history (up to ?limit=N, default 50). Versions are backed by the element_versions table. Every spec update creates a new version entry.

Error Codes

CodeClassRetryableDescription
PLATFORM_KEY_NOT_CONFIGURED?noPLATFORM_MASTER_KEY environment variable is not set
DECRYPTION_FAILED?noCiphertext is invalid, tampered, truncated, or was produced with a different key version
ALGORITHM_NOT_SUPPORTED?nospec.algorithm or spec.key_source is set to a value declared but not yet implemented

Observability

Defined for this element

Metrics

  • encryption_key_encrypt_count
  • encryption_key_decrypt_count
  • encryption_key_error_count

Pricing / cost

Platform default

Operation costs

  • create: free
  • update: free
  • delete: free
  • get: free
  • list: free
  • invoke: 10000 micro-AU
  • tool_use: free