Skip to main content
View Markdown ↗

Copy this page

Select and copy the Markdown below, then paste it into your LLM.

On this page

Marking grammar

Status: available on main, in testifysec/connectors/internal/marking/.

A connector's --classification value is parsed by this grammar. A marking that does not parse is an error; the parser never guesses.

Vocabulary

The tokens the parser knows live in one data file, testifysec/connectors/internal/marking/tokens.json, each with the regulation or manual it comes from. Adding a token means adding it there with its source. This page describes the structure; the file is the list.

Characters

The input is upper-cased and must match ^[A-Z0-9 ,/-]{1,512}$: letters, digits, space, comma, slash and hyphen, at most 512 characters. A newline, <, . or anything else is refused.

Structure

A marking is groups separated by //. The first group is the level; the rest follow in a fixed order, and a group may appear once.

OrderGroupExample valuesAllowed with
0LevelUNCLASSIFIED, CONFIDENTIAL, SECRET, TOP SECRET, and a controlled unclassified levelalways first
1Compartments (SCI)a control system, optionally with -SUFFIX sub-compartmentsclassified levels
2Special access programsSAR- followed by an identifierclassified levels
3Atomic energy markingsrestricted data and its variantsany
4Foreign government informationFGI, optionally followed by country codesany
5Controlled unclassified categoriesthe categories for the controlled unclassified levelthat level only
6Dissemination controlsoriginator and imagery controls, foreign-release limits, proprietarysee below
7Non-intelligence controlslimited, exclusive and no distribution, and agency-specific labelsany

REL TO and DISPLAY ONLY lists sit in the dissemination group. Inside any other group, values are separated by / and may come in any order; the parser prints them in a canonical order.

Below CONFIDENTIAL only the limited-dissemination controls defined for the controlled unclassified level are allowed; a classified-only control on an unclassified marking is refused.

Release lists

REL TO lists start with USA, then ISO 3166-1 alpha-3 country codes in alphabetical order, then coalition codes (ACGU, FVEY, NATO), which expand to their members when markings are compared. A list may appear once. A code that exists only in another standard is refused. A marking cannot carry both a release list and the control that forbids foreign release.

--classification takes the banner form only, such as SECRET//REL TO USA, FVEY. Portion marks such as (S//REL TO USA, FVEY), abbreviated control names and retired legacy markings are refused.

Examples

InputResult
SECRETparses
SECRET//REL TO USA, FVEYparses
secret//rel to usa, fveyparses; upper-cased
CONFIDENTIAL//REL TO USA, CAN, GBRparses
CONFIDENTIAL//REL TO USA, GBR, CANrefused: countries after USA must be in alphabetical order
SECRET/REL TO USA, FVEYrefused: a single / does not separate groups
SECRET//REL TO FVEY, USArefused: USA must come first
(S//REL TO USA, FVEY)refused: portion marks are not accepted
SECRET//REL TO USA, XYZrefused: unknown country code

These examples were run against the parser; SECRET dominates SECRET//REL TO USA, FVEY and not the reverse.

Comparing markings

The rules for dominance (may data with marking B flow to a place accredited for A?) and join (the high-water mark of two markings) are in classification markings. In code they are Dominates and Join in dominance.go; the Lean model in PR #182 checks both against 441 pairs each.

Reference generated from the product documentation. Match commands and support details to your installed release.