{"record":{"id":"544fae4309a6ad4d","repo":"mastra-ai/mastra","slug":"processor-tripwire-triggered","errorCode":null,"errorMessage":"Processor tripwire triggered","messagePattern":"Processor tripwire triggered","errorType":"exception","errorClass":"TripWire","httpStatus":null,"severity":"warning","filePath":"packages/core/src/workflows/workflow.ts","lineNumber":2941,"sourceCode":"          },\n        );\n      }\n    }\n\n    if (res.status === 'failed') {\n      const isNonRetryable = Object.values(res.steps).some(stepResult => {\n        const result = stepResult as StepResult<any, any, any, any>;\n        return result.status === 'failed' && result.nonRetryable;\n      });\n      if (isNonRetryable) {\n        throw new MastraNonRetryableError(res.error.message, { cause: res.error });\n      }\n      throw res.error;\n    }\n\n    if (res.status === 'tripwire') {\n      const tripwire = res.tripwire;\n      throw new TripWire(\n        tripwire?.reason || 'Processor tripwire triggered',\n        {\n          retry: tripwire?.retry,\n          metadata: tripwire?.metadata,\n        },\n        tripwire?.processorId,\n      );\n    }\n\n    return res.status === 'success' ? res.result : undefined;\n  }\n\n  async listWorkflowRuns(args?: StorageListWorkflowRunsInput) {\n    const storage = this.#mastra?.getStorage();\n    if (!storage) {\n      this.logger.debug('Cannot get workflow runs. Mastra storage is not initialized');\n      return { runs: [], total: 0 };\n    }","sourceCodeStart":2923,"sourceCodeEnd":2959,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/workflow.ts#L2923-L2959","documentation":"When a run ends with status 'tripwire' — a processor called `tripwire` to abort — start() throws a TripWire error. The reason, retry flag, metadata, and processorId come from the tripwire payload; the literal 'Processor tripwire triggered' is the fallback message when no reason was supplied.","triggerScenarios":"A processor (e.g. PII/safety/guardrail processor) invokes `tripwire({ reason, retry, metadata })` during a workflow step's message processing, and the run then reaches `start()`'s tripwire branch.","commonSituations":"Guardrail processors blocking sensitive content; moderation/safety processors aborting execution; forgetting to catch TripWire in calling code.","solutions":["Catch TripWire specifically: `catch (e) { if (e instanceof TripWire) { ... } }` and inspect e.reason/metadata/processorId.","Adjust or relax the offending processor's detection rules if the trip was a false positive.","If `retry: true` was set, re-run with modified input after addressing the reason.","Supply an explicit `reason` in your processor's tripwire call for clearer errors."],"exampleFix":"// before\nawait run.start({ inputData });\n// after\ntry {\n  await run.start({ inputData });\n} catch (e) {\n  if (e instanceof TripWire) {\n    console.warn('blocked by processor', e.processorId, e.reason, e.metadata);\n  } else throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isTripWire(e: unknown): e is TripWire {\n  return e instanceof TripWire;\n}","tryCatchPattern":"try {\n  await run.start({ inputData });\n} catch (e) {\n  if (e instanceof TripWire) {\n    console.warn('tripwire', e.processorId, e.reason, e.metadata, 'retry:', e.retry);\n  } else throw e;\n}","preventionTips":["Always catch TripWire separately from generic errors around run.start().","Provide explicit reasons/metadata in processor tripwire calls.","Review guardrail processor thresholds to avoid false positives."],"tags":["workflow","tripwire","processor","guardrails"],"backgroundTag":"tripwire-abort","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}