Talk to the Team

Tell us about your stack and the privacy problems you're trying to solve. We typically respond within one business day.

Prefer email? support@philterd.ai

Prefer to skip the form? Pick a time on our calendar →
or send a message

Please do not enter PII or PHI in this form. If you need to share an example, use a sanitized one.

← All policies

Finance · Philterd

SWIFT / BIC Codes

Redact SWIFT/BIC bank and business identifier codes (ISO 9362), validated structurally including a valid ISO 3166 country segment.

v1.0.0 Updated 2026-06-15 Philter Requires Phileas 4.1.0+ (redaction policy schema 1.1.0 with the bic-structural validator) By Philterd
SWIFTBICISO 9362bankingwire transfer

The policy

The full swift-bic-codes.json file. The same content you’d get by downloading. Copy any part of it, or use the buttons in the hero to grab the whole file.

{
  "config": {
    "splitting": {
      "enabled": false,
      "threshold": 4000
    }
  },
  "ignored": [],
  "identifiers": {
    "identifiers": [
      {
        "classification": "swift-bic",
        "pattern": "\\b[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?\\b",
        "caseSensitive": true,
        "validator": "bic-structural",
        "identifierFilterStrategies": [
          {
            "strategy": "REDACT",
            "redactionFormat": "[REDACTED-SWIFT-BIC]"
          }
        ]
      }
    ]
  }
}

Example

Input

Send the wire to DEUTDEFF (or DEUTDEFF500 for the branch).

Output

Send the wire to [REDACTED-SWIFT-BIC] (or [REDACTED-SWIFT-BIC] for the branch).

Entities this policy acts on

SWIFT_BIC

What this policy does

Detects and redacts SWIFT/BIC codes using Phileas’s generic identifier filter with the bic-structural validator. SWIFT/BIC has no checksum, so the validator checks the ISO 9362 structure (4 letters institution, 2 letters country, 2 alphanumeric location, optional 3 alphanumeric branch, for a length of 8 or 11) and requires the country segment to be a valid ISO 3166-1 alpha-2 code.

Matches are replaced with [REDACTED-SWIFT-BIC].

Why the validator matters

The BIC shape alone would match strings that merely look like a BIC. The validator keeps a match only if it is structurally valid with a real country code, so DEUTZZFF (a BIC shape with the unassigned country ZZ) is left in place while DEUTDEFF is redacted. A structurally valid code is not guaranteed to be an assigned BIC, so detection remains probabilistic; validate against your own documents.

Test vectors

  • Valid 8-character: DEUTDEFF, BOFAUS3N. Valid 11-character: DEUTDEFF500.
  • Invalid 8-character (unassigned country ZZ): DEUTZZFF. Invalid 11-character: DEUTZZFF500.

Contextual cues

In free text, anchor on a nearby cue (“SWIFT”, “BIC”) and capture only the code with groupNumber:

{
  "classification": "swift-bic",
  "pattern": "(?:SWIFT|BIC)[\\s:#-]*([A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?)",
  "caseSensitive": true,
  "groupNumber": 1,
  "validator": "bic-structural",
  "identifierFilterStrategies": [
    { "strategy": "REDACT", "redactionFormat": "[REDACTED-SWIFT-BIC]" }
  ]
}

This trades recall for precision.

Prerequisites

Use Phileas 4.1.0 or later, which provides redaction policy schema 1.1.0 and the bic-structural validator. The example input and output were verified against Phileas 4.1.0.

References

Use this policy

Download and load into your running Philter instance:

# Download the policy
curl -O https://raw.githubusercontent.com/philterd/pii-redaction-policies/main/policies/philterd/finance/swift-bic-codes.json

# Upload to your Philter instance
curl -X POST http://localhost:8080/api/policies \
     -H "Content-Type: application/json" \
     --data @swift-bic-codes.json

# Redact text using the policy
curl http://localhost:8080/api/filter?p=swift-bic-codes \
     --data "your text here" \
     -H "Content-Type: text/plain"

No Philter instance yet? Deploy one in 5 minutes → · Want to tune this policy against your data? Talk to the team.