---
skill: lfcs-sanitise-for-external
version: 1
status: live
model: claude-haiku-4-5-20251001
inputs:
  - source artefact (xlsx path, docx path, markdown text, or dict record set)
  - operator_of_record (human name e.g. "Liam Fitzgerald")
  - company (default "LF Construction Services Pty Ltd")
outputs:
  - sanitised artefact (file at output_path or dict)
  - SanitisationResult (fields_stripped, regex_strips_applied, metadata_overrides)
  - _Internal_Sanitisation_Log row (caller writes via orchestrator)
implementation: HQ-Vault/11_OpsMan_LFCS/Codebase/lfcs-pricing-agent/lib/sanitise.py
---

# lfcs-sanitise-for-external (Layer 1 of two)

Strips `_internal_*` fields, regex-strips agent-derivation patterns, overrides
file metadata. Per Stage 4 § 2.2.2.

**This is Layer 1 only.** Layer 2 (`lfcs-sanitisation-verify`) is INDEPENDENT
and runs after this skill. Both must pass before the artefact may be sent
externally. The two layers maintain SEPARATE regex pattern lists by design —
drift between them is detected at Layer 2.

## What gets stripped

- Any field whose name starts `_internal_` (case-insensitive)
- Any whole table starting `_Internal_` (defensive — shouldn't appear in xlsx anyway)
- Cell comments + cell values matching agent-derivation regex patterns:
  - `claude-code` / `claude-opus` / `claude-sonnet` / `claude-haiku` / `claude-code-coo` etc.
  - `cowork-lfcs` / `cowork-hq`
  - `hermes-coo` / `hermes-opsman` / `openclaw` / `openclaw-opsman`
  - `agent rate` / `agent confidence` / `agent derivation`
  - `[source: friend-vault]` and `[source: ...]` general tags
  - `_internal_*` prefix mentions in body text
  - `PLACEHOLDER-*` tags + `(PENDING DERIVE)` markers
  - Frontmatter `created_by:` lines

## File metadata override (xlsx + docx)

- `Author = operator_of_record`
- `LastModifiedBy = operator_of_record`
- `Company = "LF Construction Services Pty Ltd"`
- `Comments = ""` (cleared)

## Failure mode

Returns `layer1_pass=False` + a notes message if openpyxl unavailable.
Caller MUST treat any failure as fail-closed (do not send artefact externally).

## Worked example

See Stage 4 § 2.2.3 — generating an LoO PDF for Robert at Civil Experts.

## Related

- `lfcs-sanitisation-verify` (Layer 2 — runs after this; independent code path)
- `lfcs-letter-of-offer-draft` (typically the upstream skill that produces the
  source artefact)
