Skip to content

Identifier detector

Australian TFN: format, validation and detection

Updated Australiatax IDDetector key au_tfn

Short answer

An Australian tax file number has 8 or 9 digits whose weighted sum is divisible by 11. For nine digits the weights are 1, 4, 3, 7, 5, 8, 6, 9, 10; for eight digits they are 10, 7, 8, 4, 6, 3, 5, 1.

What it is

The TFN identifies taxpayers in Australia. Maskflare's Australia pack covers it as a tax ID, with an unformatted sibling for runs with no spaces.

In Maskflare this is the detector au_tfn, labelled "Australia - Tax file number (TFN)", category tax id, in the Australia pack.

Format and layout

  • Nine digits grouped 3-3-3 with spaces, for example 123 456 782, or an eight-digit form (3-3-2).
  • All digits cannot be the same.

How the check works

Multiply each digit by its weight and add the products. The total must be a multiple of 11.

Worked example

  1. Digits 1 2 3 4 5 6 7 8 2 with weights 1 4 3 7 5 8 6 9 10 give 1, 8, 9, 28, 25, 48, 42, 72, 20.
  2. The total is 253, which is 23 times 11, so the number passes.

Valid and invalid examples

Synthetic values. Each was run through Maskflare's own validator and pattern when this page was generated.
ExampleResultWhy
123 456 782ValidMatches the layout and passes the validator.
123 456 780InvalidThe invalid example changes one character, the last character: 2 becomes 0.

In running text the valid example reads, for instance, TFN 123 456 782. The invalid one is left alone: a value that fails the validator is treated as an ordinary string.

Regex and validation caveats

  • About one in 11 random nine-digit numbers passes, so the unformatted sibling detector needs a keyword before the number; the spaced form is matched on its own.
  • Australia has no compliance profile in Maskflare, so the detector depends on the primary country setting.

How to detect it in LLM traffic

Australian TFN values reach an LLM inside ordinary work rather than as standalone data: a pasted block of HR or payroll rows, a customer-support thread, an onboarding or identity-check form, a spreadsheet someone wants summarised, or an email they want rewritten. The model needs none of the digits for any of those jobs, so the safest place to remove them is before the request leaves the company.

Maskflare reads the whole request body, including the system prompt, earlier messages and tool arguments, so a number buried in the fourth message of a long chat is found as readily as one in the latest message. Each match is replaced with a token such as mf_mask_d7e0 before the request goes out, and with response restoration turned on the real value is put back into the answer for the person who is allowed to see it.

If you build the detection yourself

  1. Strip spaces, dots and hyphens before running any arithmetic, but remember where they were so the original text can be replaced exactly.
  2. Match the shape with a pattern anchored on word boundaries, so that a long digit string is not read as several shorter Australian TFN candidates.
  3. Run the check from the section above. A failing check is almost always a typo or a made-up value; a passing one removes most look-alikes.
  4. Replace the value before the text is sent anywhere, and keep a mapping if the answer has to be restored afterwards.

How Maskflare handles it

  • Protect now, Finance - Protect now, Healthcare and Developer: mask (a reversible token) when Australia is a primary country.
  • Monitor first: alert (counted, forwarded unchanged) when Australia is a primary country.

The available actions are mask (reversible token), redact, partial, hash, format-preserving encryption, generalize, alert and block. Masked values are kept encrypted for 30 days so that answers can be restored, then they expire; prompts and responses are not logged. The full list of detectors is in the detector reference.

Compliance profiles that include it

None of the 6 compliance profiles (HIPAA Safe Harbor, GDPR (EU/EEA), UK GDPR, PCI DSS v4.0, US PII (CCPA/CPRA) and Swiss nDSG health data) includes the Australia pack, so no profile turns this detector on. It runs when the pack is enabled directly, or when Australia is chosen as a primary country.

Frequently asked questions

How is a TFN validated?

Multiply each digit by its weight (a different set for eight and nine digits) and require the total to be divisible by 11.

Does Maskflare accept eight-digit TFNs?

Yes, with their own weights.

Is the Australian TFN detector on by default?

It depends on the organisation's primary countries. It is part of the Australia pack, which the default Protect now template turns on with the action mask when Australia is a primary country.

Does a valid Australian TFN prove the person exists?

No. A check digit shows the value is well formed. Many valid-looking numbers have never been issued, and Maskflare masks them all the same.

Rules on this page describe what Maskflare's detectors and validators check. They are read from the detection catalogue and are not the specification of the body that issues the identifier. Examples are synthetic.

Related pages

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.