Skip to content

feat(api+engine): add per-workspace all-actions override for error details - #3599

Open
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1790168624-break-glass-error-details
Open

devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1790168624-break-glass-error-details

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Read CONTRIBUTING.md.
  • PR title is short and non-generic.
  • PR only implements a single feature or fixes a single bug.
  • Tests passing (uv run pytest tests/unit/test_executor_service.py tests/unit/test_organization_settings.py tests/unit/api/test_api_workspaces.py tests/unit/test_agent_tokens.py tests/unit/test_durable_agent_workflow_search_attributes.py)
  • Lint / pre-commits passing

Description

Extends #3497 (org-gated per-action "Show error details") with two things:

1. Org-level all-actions list per workspace. New org setting
app_unsafe_disable_secret_error_withholding_all_actions_workspace_ids. Any workspace in
that list has secret error withholding disabled for every action, no per-action opt-in
required. The two lists resolve to a single policy (tracecat/settings/types.py):

WorkspaceErrorDetailsPolicy
  DISABLED    workspace in all-actions list        -> always show original error
  PER_ACTION  workspace in existing allow-list     -> show only if action opted in
  WITHHOLD    otherwise / lookup failed / malformed -> withhold (fail closed)

workspace_allows_error_details() is replaced by workspace_error_details_policy().
The executor now resolves the policy on every invoke_once (TTL-cached 15s per
org+workspace, as before) instead of only when the action opted in, so all-actions list
applies to actions that never touched the toggle. Known secret values are still masked
in all modes; this only controls withholding of the diagnostic message.

WorkspaceRead gains unsafe_disable_secret_error_withholding_forced alongside the
existing _allowed. The action panel shows the switch as on + disabled with an
"Always enabled ... (all-actions list)" label when forced. Org app settings get a second
workspace checklist for the all-actions list (the checklist is factored into
WorkspaceListField).

2. Agent action opt-in cascades to tool calls. Setting "Show error details" on an
agent action now flows to every registry tool the agent invokes:

ActionStatement.unsafe_disable_secret_error_withholding
  -> AgentWorkflowArgs (dsl/workflow.py, both preset and direct agent paths)
  -> DurableAgentWorkflow -> mint_mcp_token(...)
  -> MCPTokenClaims.unsafe_disable_secret_error_withholding
  -> mcp/executor.build_run_input -> tool ActionStatement
  -> executor invoke_once (same org policy gate as any other action)

The flag is still subject to the org workspace policy at execution time; it does not
bypass gating on its own.

Related Issues

Follow-up to #3497.

Steps to QA

  1. Org settings > Application: add a workspace to "All-actions list: workspaces with error
    details always shown". Open any action in that workspace: the "Show error details"
    switch is on and disabled with the all-actions label. Run an action that fails with a
    secret in scope: original message shown, secret value masked.
  2. Remove it from all-actions list, add it to "Workspaces allowed to show error details":
    switch is enabled; behaviour follows the per-action toggle.
  3. Enable "Show error details" on an agent action whose tool fails with a secret in
    scope (workspace in the allow-list): the tool error surfaced to the agent shows the
    original message rather than "Details withheld".

LOC breakdown

Category + -
Logic 258 76
Tests 197 54
Generated 36 0

Link to Devin session: https://app.devin.ai/sessions/9a7f6736d6e447dd8187729120e3c4ba
Open in Devin Desktop: https://app.devin.ai/desktop/session/9a7f6736d6e447dd8187729120e3c4ba?variant=devin

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions github-actions Bot added api Area: backend API, auth, admin, and webhooks engine Area: workflow engine — Temporal workers, executors, DSL, sandbox feat Type: new feature or capability (feat:) labels Sep 23, 2026
@zeropath-ai

zeropath-ai Bot commented Sep 23, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 1d11d77.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► frontend/src/client/schemas.gen.ts
      Add App Unsafe Disable Secret Error Withholding All Actions Workspace Ids
► frontend/src/client/types.gen.ts
      Add app_unsafe_disable_secret_error_withholding_all_actions_workspace_ids field
► frontend/src/components/builder/panel/action-panel.tsx
      Display and respect forced error details withholding per workspace setting
► frontend/src/organization/org-settings-app.tsx
      Add UI to manage all-actions and per-action error withholding workspace lists
► frontend/src/components/organization/org-settings-app.tsx
      Introduce WorkspaceListField to manage workspace selections
► frontend/src/components/organization/org-settings-app.tsx
      Integrate all-actions workspace list field
► packages/tracecat-ee/tracecat_ee/agent/workflows/durable.py
      Propagate unsafe_disable_secret_error_withholding through run context
► tests/unit/api/test_api_workspaces.py
      Parameterize tests for new policy and forced flag
► tests/unit/test_agent_tokens.py
      Add tests for MCP token and run input propagation of error withholding
► tests/unit/test_executor_service.py
      Update tests to cover WorkspaceErrorDetailsPolicy and related logic
► tests/unit/test_organization_settings.py
      Update tests to include new policy and settings fields
► tracecat/agent/backends/schemas.py
      Add unsafe_disable_secret_error_withholding field to AgentWorkflowArgs
► tracecat/agent/mcp/executor.py
      Pass through unsafe_disable_secret_error_withholding from claims to run input
► tracecat/dsl/workflow.py
      Carry unsafe_disable_secret_error_withholding into child workflows
► tracecat/executor/service.py
      Use workspace_error_details_policy and WorkspaceErrorDetailsPolicy type; adapt logic to policy-based withholding
► tracecat/settings/schemas.py
      Add app_unsafe_disable_secret_error_withholding_all_actions_workspace_ids field to AppSettingsRead and AppSettingsUpdate
► tracecat/settings/service.py
      Introduce workspace_error_details_policy function and support for all-actions vs per-action lists
► tracecat/settings/types.py
      Add WorkspaceErrorDetailsPolicy enum with WITHHOLD, PER_ACTION, DISABLED
► tracecat/workspaces/router.py
      Query and expose error withholding policy and forced flag in workspace read
► tracecat/workspaces/schemas.py
      Add unsafe_disable_secret_error_withholding_forced field to WorkspaceRead
► tests/unit/api/test_api_workspaces.py
      Update test to assert new forced flag and allowed behavior
► tests/unit/test_executor_service.py
      Add tests around policy resolution and forced behavior
► tests/unit/test_organization_settings.py
      Update test scaffolding to include new policy-based fields

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Browser-tested locally against the PR branch with a real workflow and a synthetic secret.

Break-glass disclosure and withholding restoration

With the action's saved opt-in off, break glass exposed Illegal header value b'***\n' while masking the secret. Removing the workspace from both policy lists and rerunning the unchanged workflow restored Details withheld: secrets may be in scope.

Break glass enabled Break glass removed
Original error with secret masked Withholding restored
Additional checks and scope
  • Save/reload persistence for both workspace checklists.
  • All three action-switch states, including forced checked/disabled under break glass.
  • No secret value appeared in either surfaced error.
  • Not tested: agent MCP-token cascade to tool calls (covered by unit tests only).

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Follow-up browser QA with real Anthropic Claude Haiku executions, covering the agent → MCP registry-tool cascade.

Agent error-details cascade

Workspace allow-listed for per-action opt-in, not break glass. Both runs made one core.http_request call with a valid secret reference plus a trailing newline in a header.

  • Show error details OFF: tool error returned Details withheld: secrets may be in scope.
  • Show error details ON: tool error returned Illegal header value b'***\n'.
  • Transcript, tool result, agent output, and execution events contained no plaintext secret.
OFF — withholding ON — masked original error
OFF actual registry-tool error ON actual registry-tool error
Environment and scope

Local agent execution needed --no-sandbox (host namespace restrictions blocked nsjail); sandboxed execution and an exhaustive backend-log leakage audit were not covered. Org policy lists restored to empty afterward.

…ting

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title feat(api+engine): add per-workspace break-glass for error details feat(api+engine): add per-workspace all-actions override for error details Sep 23, 2026
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Area: backend API, auth, admin, and webhooks engine Area: workflow engine — Temporal workers, executors, DSL, sandbox feat Type: new feature or capability (feat:)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant