When building LLM-powered applications, a builder prompt might successfully redact private repository URLs, but a subsequent reviewer prompt often receives the raw source card or draft containing those same sensitive values. This creates a security gap where derived question summaries or structured payloads inadvertently carry private data into new model contexts.

Quick solution:

function sanitizeContext(input) { const privateUrlPattern = /https:\/\/github\.com\/your-org\/[^\s]+/g; return input.replace(privateUrlPattern, '[REDACTED]'); } 

Why Reviewer Calls Are Separate Privacy Boundaries

Each model request acts as a distinct data-egress boundary. Even if a builder prompt is secured, the reviewer model call often requires a different set of context, such as extracted source-brief questions or draft payloads. If these fields are not independently sanitized, they can act as vectors for sensitive information disclosure. As noted in the OWASP LLM02:2025 Sensitive Information Disclosure guidance, relying on prompt instructions to avoid private data is insufficient; application-side redaction is a mandatory control to prevent accidental exposure.

Identifying Vulnerable Fields

Sensitive data can propagate through several fields during the lifecycle of a draft. Specifically, you must audit and sanitize:

  • Source Text: The raw input provided to the model.
  • Derived Question Summaries: Automatically generated summaries that may capture URLs.
  • Structured Draft Payloads: JSON objects containing metadata or draft content.
  • Validator Feedback: Logs or feedback loops that might echo back input data.

When managing these fields, it is helpful to Separate SEO Title Readability from Ranking Rules to ensure your metadata remains clean and focused, just as your data payloads must remain free of internal identifiers.

Testing for Redaction Integrity

To ensure your sanitization logic is effective, implement regression tests that verify the removal of private URLs while preserving public source URLs. Your test suite should:

  1. Define a test case containing both a private repository URL and a public URL.
  2. Run the sanitization function against the input.
  3. Assert that the private URL is replaced by a redaction marker (e.g., [REDACTED]).
  4. Assert that the public URL remains untouched and valid.

Deterministic validation must remain in place even after prompt redaction. Relying solely on the model to "understand" privacy instructions is a failure mode; automated tests provide the necessary verification that the redaction logic is applied consistently across all model calls.

Verification Checklist

  • [ ] Audit all fields passed to the reviewer model for potential private URL inclusion.
  • [ ] Implement a centralized sanitization function for all outgoing model payloads.
  • [ ] Add regression tests to verify that private URLs are redacted while public URLs remain intact.
  • [ ] Ensure deterministic validation checks run after the sanitization step to confirm the final payload is clean.