n8n-io/n8n · error · Error

The marker "${redactedKey}" was not found.

Error message

The marker "${redactedKey}" was not found.

What it means

Thrown by browser_capture_secret when the redactedKey supplied does not match any marker in the markerMap built from the page's sensitivity hits. The tool probes the page HTML, analyzes it for secret-bearing fields, formats each hit as a redaction marker, and looks up the requested key; a miss means the key is not present in the current page content.

Source

Thrown at packages/@n8n/mcp-browser/src/tools/credential.ts:77

		connection,
		'browser_capture_secret',
		'Read a secret value from a DOM element (identified by a snapshot ref) and store it in the session buffer. The value is never returned to the LLM. Use browser_create_credential to assemble buffered secrets into a credential.',
		browserCaptureSecretSchema,
		async (state, args, pageId, context) => {
			requireSecretsBuffer(context);
			let value = '';
			if ('redactedKey' in args.element) {
				const { redactedKey } = args.element;
				const sensitivity = analyzeHtmlSensitivity(await state.adapter.probePageHtml(pageId));
				if (sensitivity.ok) {
					const formatMarker = createRedactionMarkerFormatter(sensitivity.hits);
					const markerMap = sensitivity.hits.reduce((result, hit) => {
						result.set(formatMarker(hit), hit.value);
						return result;
					}, new Map<string, string>());

					if (!markerMap.get(redactedKey)) {
						throw new Error(`The marker "${redactedKey}" was not found.`);
					}
					value = markerMap.get(redactedKey)!;
				} else {
					throw new Error(`Secret capturing failed with error: ${sensitivity.error}`);
				}
			} else {
				value = await state.adapter.getElementValue(pageId, { ref: args.element.ref });
			}
			context.secretsBuffer.capture(args.credentialsKey, args.field, value);
			return formatCallToolResult({ ok: true, fieldsCaptured: [args.field] });
		},
		undefined,
		{ skipEnrichment: true },
	);
}

// ---------------------------------------------------------------------------
// browser_create_credential

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Re-run browser_snapshot with { interactive: false } to refresh the list of redacted keys, then use a key from the new snapshot.
  2. Ensure the pageId matches the page containing the secret element.
  3. Verify the redactedKey string exactly matches the format returned by the snapshot (including brackets and index).

Example fix

// before — stale redactedKey
await captureSecret({ redactedKey: '[REDACTED:password:1]', ... }); // throws

// after — refresh snapshot, use a current key
const snap = await snapshot({ interactive: false });
await captureSecret({ redactedKey: snap.redactedKeys[0], ... });
Defensive patterns

Strategy: validation

Validate before calling

const sensitivity = analyzeHtmlSensitivity(await adapter.probePageHtml(pageId));
if (!sensitivity.ok) throw new Error(sensitivity.error);
const marker = createRedactionMarkerFormatter(sensitivity.hits);
const valid = new Set(sensitivity.hits.map(marker));
if (!valid.has(redactedKey)) { /* refresh snapshot, pick a valid key */ }

Type guard

function markerExists(hits: SensitivityHit[], key: string): boolean {
  const fmt = createRedactionMarkerFormatter(hits);
  return hits.some((h) => fmt(h) === key);
}

Try / catch

try {
  await captureSecret({ redactedKey, ... });
} catch (e) {
  if (/marker .* was not found/.test(e.message)) {
    const snap = await snapshot({ interactive: false });
    await captureSecret({ redactedKey: snap.redactedKeys[0], ... });
  } else throw e;
}

Prevention

When it happens

Trigger: Passing a redactedKey (e.g. "[REDACTED:password:1]") that does not correspond to any sensitivity hit on the current page. Common when the key was read from a stale snapshot, the page changed, or the key format doesn't match createRedactionMarkerFormatter output.

Common situations: Page navigated or re-rendered after the snapshot that produced the redactedKey. Using a key from a different pageId. Marker format mismatch (formatter changed between versions). Secret field is in a shadow DOM or iframe the HTML probe didn't reach.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/586ffec57bb33398. Report an issue: GitHub.