Safe examples
Decides what data can appear in examples, sample output, logs, and screenshots, and who checks a piece for secrets and personal data before it ships.
Examples in software content are copied, pasted, run, and indexed. A real value in one of them does damage that no edit can undo: a token in a code block gives access to whoever finds it, and a customer’s email address in a screenshot is a privacy breach. This section decides what data can appear in examples, sample output, logs, and images, and who checks before a piece ships.
glob-placeholder-data in Global and legal sets the floor, at the never tier: no real names, email addresses, phone numbers, or domains in an example. The rules here list the reserved sets to use instead and extend the floor to the rest of what software content carries: IPv6 and internal addresses, identifiers, secrets, personal and customer data, pasted output, and screenshots. Placeholders the reader replaces follow code-placeholders in Code and technical terms.
Two rules here are never-tier: a real secret and real personal data. Either one in a published piece is a security or privacy incident. The fix starts with revoking the secret or reporting the exposure to whoever owns security at the company, and only then is the page corrected.
Names, addresses, and identifiers
Reserved names and addresses
Use reserved names and addresses for every host, domain, address, and phone number in an example. Domains: example.com, example.net, and example.org, and any name under the .example, .test, and .invalid top-level domains, as Request for Comments (RFC) 2606 reserves them. IPv4 addresses: 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24, from RFC 5737. IPv6 addresses: 2001:db8::/32, from RFC 3849. Phone numbers: 555-0100 to 555-0199 in any North American area code, the range set aside for fiction. Don’t use private ranges such as 10.0.0.0/8 or the company’s own internal hostnames either: they show how the company’s network is laid out, and the reader’s network can use the same addresses for something else. Use .invalid for a name that must never resolve, such as an example of a mistyped host. A pattern catches addresses and domains outside these sets.
billing-db-01.corp.internal and the address to fd00:ab12::7.db.example.com and the address to 2001:db8::7.Visibly invented identifiers
Make every account number, customer ID, order number, and other identifier in an example visibly invented. Readers paste examples into scripts and support tickets, and a real-looking ID can belong to a real customer. Use a value that shows the format and announces itself: zeros, a repeated digit, or the word EXAMPLE where the format allows letters. For a universally unique identifier (UUID), use 00000000-0000-0000-0000-000000000000. For a payment card, use only the test numbers the payment processor documents. Never copy an identifier from production, even one that looks meaningless.
GET /v1/orders/ord_7Hq2mX9pLr4K.GET /v1/orders/ord_EXAMPLE0001.Secrets
No real secrets
Never publish a real secret, in any form. A secret is anything that grants access: an API key, a password, an access or refresh token, a private key, a session cookie, a signed URL, a webhook signing secret, or a connection string that contains a password. The rule covers a secret that has expired, been revoked, or belongs to a test account: automated scanners harvest public repositories and pages continuously, a reader can’t tell a dead key from a live one, and the example teaches readers to paste keys into documents. Show a placeholder in the form code-placeholders sets, such as <your-api-key>. If a real secret is published, treat it as compromised: revoke and rotate it first, then remove it, because deleting the page doesn’t delete the copies.
export ACME_API_KEY= followed by the team’s staging key, pasted in full because it was revoked last week.export ACME_API_KEY=<your-api-key>Visibly fake secret values
When an example must show what a secret looks like, make the value visibly fake and give secret scanners nothing to match. Some examples need a realistic value, such as a configuration file where a placeholder would break the syntax. Use a value that contains the word EXAMPLE and a repeated pattern, and don’t reproduce a real provider’s prefix and length (such as ghp_ for a GitHub token or AKIA for an Amazon Web Services (AWS) access key), because scanners match those and will block a commit or wake an on-call engineer over a sample. Where a provider publishes an official example value, use that one. A random-looking string is the worst choice: readers can’t tell it’s fake, and neither can a scanner. A pattern catches provider prefixes and long random strings in examples.
ACME_TOKEN= followed by 40 random letters and digits.ACME_TOKEN=EXAMPLE-TOKEN-0000-0000-0000Personal and customer data
No real personal or customer data
Never publish real personal information or customer data in an example, a sample dataset, a log, or a screenshot. Personal information is anything that identifies a person or can be tied to one: names, email addresses, phone numbers, postal addresses, IP addresses, account and order details, support ticket text, and photos. Customer data is anything a customer stored in the product, whether or not it names anyone. Publishing either can breach privacy law and always breaches the customer’s trust. The rule covers colleagues’ details and your own, because a published example is copied and kept long after anyone agreed to it. Invent the people and the data: names that belong to no known person, addresses at example.com, and phone numbers in the 555-0100 to 555-0199 range.
Ana Example, ana@example.com, +1 613 555 0142.Examples from a demo account
Produce examples, screenshots, and sample output from a demo account filled with invented data. A dedicated account or sandbox with invented users, invented customers, and example.com addresses makes most of this section automatic, because nothing real is on the screen to leak. Keep its data believable, so the example still teaches, and keep it apart from production, so no real record drifts in. When only a real account can show something, safe-redact-output and safe-inspect-screenshots apply in full.
Output and images
Redact pasted output
Redact logs, error output, requests, responses, and configuration files before you paste them. Real output carries more than the error: tokens in headers and URLs, cookies, email addresses, account IDs, internal hostnames, and file paths with a person’s username in them. Replace each sensitive value with a marker and keep everything else exactly as the product printed it, because code-error-verbatim requires error messages verbatim. Use the same marker for the same value throughout, such as <redacted-token> or <account-id>, so the reader can still trace each value through the output, and say once that values were redacted. Check the whole paste, not only the lines you meant to show: secrets hide in stack traces, query strings, and environment dumps.
Authorization: Bearer followed by the live token, copied from the terminal.Authorization: Bearer <redacted-token>Inspect every screenshot
Inspect every screenshot and screen recording for sensitive detail before it ships. Look at the whole image, not only the part you meant to show. Check headers and sidebars for names, email addresses, and avatars. Check fields and address bars for tokens and IDs. Check the edges for internal URLs, browser tabs, bookmarks, and notifications, and the background for customer data in the tables behind a dialog. Cover anything sensitive with a solid box or retake the image, because blurring and pixelation can be reversed and an annotation layer can be lifted off an editable file. Strip the file’s metadata, which can hold a location, a device name, or a username. Cropping, as img-crop-annotate asks, removes most of the risk before the inspection starts. The example pair is the image note a writer leaves for whoever prepares the screenshot.
The safety pass
A named safety pass
Name one person who does the safety pass before a piece ships, and record that it was done. The safety pass checks every example, code block, log, table, and image against this section. It’s separate from the style review, because a reviewer reading for tone reads past a token in a code block. The author can do it for a light piece with no pasted output or screenshots. For a security advisory, an incident update, and any piece with real output or screenshots, someone other than the author does it, such as the security owner or the documentation lead. Record the pass with the rest of the review. Whoever finds a secret or personal data after publication reports it to the security owner, who revokes any exposed secret before the page is corrected. This rule applies to a document.