System & Safety Nodes

Applies to: ChengOS v0.2.0+ | Last verified: 2026-09-25 | Source: crates/cheng-nodes/src/nodes/builtin/utils

Three nodes that guard the edges of an execution. utils/credential injects a stored secret by reference — it is the reason no workflow needs an API key typed into a plain field. utils/approver stops the run and waits for a human decision, which is how an otherwise autonomous graph gets a checkpoint before something irreversible. utils/preview renders intermediate content so you can see what a step actually produced while you are still building the graph.

Credential Injection — utils/credential

Load saved credentials and expose them as env vars for downstream nodes. Supports provider auto-match, provider/name selection, and legacy UUID refs.

Inputs

FieldTypeRequiredDefaultDescription
bindingsobject✅—Map each env var name to a credential ref. Ref supports provider (auto-select), provider/name (pick one), or UUID (legacy). Example: {"OPENAI_API_KEY":"openai", "GITHUB_TOKEN":"github/work"}
context_namestring—nullContext label shown in log and error messages.
strictboolean—trueWhen enabled, any missing credential stops the node. When disabled, returns resolved env vars and lists failed keys in missing_bindings.
user_idstring—nullOptional user UUID override. Leave empty to use the current workflow caller.

Outputs

FieldTypeDescription
env_varsobjectResolved env var values for downstream nodes (sensitive).
missing_bindingsarray<string>Env var keys that could not be resolved (only populated when Strict Mode is off).
resolved_countintegerHow many bindings were resolved successfully.

Approval Gate — utils/approver

Pause execution and request user authorization before performing a high-risk action. Supports one-time, session-level, and skip decisions.

Inputs

FieldTypeRequiredDefaultDescription
action_namestring✅—Name of the action requiring authorization
risk_levelenum—mediumAssessed risk of the action (low / medium / high / critical). Control: select. Options: low, medium, high, critical
descriptionstring—nullHuman-readable explanation of what the action will do
param_summarystring—nullJSON summary of action parameters shown in the approval card
extra_whiteliststring—nullExtra comma-separated action names to auto-approve in addition to session whitelist
timeout_secsinteger—300Seconds to wait before auto-rejecting if no response (default 300)

Outputs

FieldTypeDescription
approvedbooleanTrue when the action is allowed to proceed
approved_outbooleanRuntime-conditional boolean emitted only when approval is granted.
outcomeenumDetailed approval outcome. Options: approved (User approved the action (or a whitelist rule matched).), rejected (User rejected the action.), skipped (User asked to skip this action and return feedback.), timed_out (No response was received within the timeout window.)
whitelist_hitbooleanTrue if action was auto-approved via whitelist
scopestringScope granted by the user
reasonstringUser-provided reason or feedback
request_idstringUUID identifying this approval request

Content Preview — utils/preview

Display output results in preview window, supports multiple formats and statistics

Inputs

FieldTypeRequiredDefaultDescription
dataany——Data to preview
contextany——Context from Chat node
artifactobject (port)——Artifact to preview (metadata only). Connection port, not a form field.
artifactsobject (port)—[]Artifact list to preview (metadata only). Connection port, not a form field.
artifactUristring——artifact:// URI to preview
currentPageinteger—1Current page number. Control: number
displayFormatenum—rawSelect preview display format. Control: select. Options: raw (原始格式), json (JSON 格式化), table (表格视图), codeblock (代码块格式), assistantmessage (提取助手消息)
pageLengthinteger—1000Characters per page; shorter content displays directly, longer content is paginated. Control: number
showStatsboolean—trueWhether to show character count, line count and other statistics. Control: switch

Outputs

FieldTypeDescription
original_dataanyOriginal input data
preview_contentstringFormatted preview content
statisticsstringData statistics
paginationstringPagination info (provided when content needs pagination)

Next steps