Examples and sensitive data
A leaked key in a documentation example is a security incident, and a real person’s email in an example is a privacy problem. These rules check code and text, including fenced code blocks, for anything that looks like a credential or a real contact detail.
AWS access key
AWS access key IDs begin with AKIA. A real key in documentation can be found by automated scanners within minutes..
Avoid: A line that sets an environment variable to a real access key ID.
Use: export AWS_ACCESS_KEY_ID=<your-access-key-id>
Severity: error. Rule name: DocSpade.AWSAccessKey.
Private key block
A private key must never be published. Show only the beginning of the key format, or describe how to create one.
Avoid: A line that begins a private key block.
Use: Generate a private key with ssh-keygen.
Severity: error. Rule name: DocSpade.PrivateKeyBlock.
Github token
GitHub tokens begin with ghp_, gho_, ghu_, ghs_ or ghr_. Revoke any real token that reaches documentation.
Avoid: A line that sets a token to a real GitHub token.
Use: token: <your-github-token>
Severity: error. Rule name: DocSpade.GitHubToken.
Slack token
Slack tokens begin with xoxb-, xoxp-, xoxa-, xoxr- or xoxs-. A real token lets anyone act as your app.
Avoid: A line that sets a token to a real Slack token.
Use: token: <your-slack-token>
Severity: error. Rule name: DocSpade.SlackToken.
Stripe key
Stripe secret keys begin with sk_live_ or sk_test_. Use a placeholder, and never a real key, even a test key.
Avoid: A line that sets a key to a real Stripe secret key.
Use: key: <your-stripe-secret-key>
Severity: error. Rule name: DocSpade.StripeKey.
Google API key
Google API keys begin with AIza and are 39 characters long. Restrict and rotate any real key that appears in documentation.
Avoid: A line that sets a key to a real Google API key.
Use: key=<your-google-api-key>
Severity: error. Rule name: DocSpade.GoogleAPIKey.
Open AI key
Secret keys that begin with sk- are used by several AI services. Anyone who sees one can spend your account’s money.
Avoid: A line that sets a variable to a real secret API key.
Use: OPENAI_API_KEY=<your-api-key>
Severity: error. Rule name: DocSpade.OpenAIKey.
JSON web token
A JSON Web Token carries identity and permissions. A real one in documentation can be replayed until it expires.
Avoid: An Authorization header that holds a real JSON Web Token.
Use: Authorization: Bearer <your-token>
Severity: error. Rule name: DocSpade.JSONWebToken.
Bearer token
A long literal after ‘Bearer’ is almost certainly a real credential. Write ‘Bearer <your-token>’.
Avoid: An Authorization header that holds a long literal token.
Use: Authorization: Bearer <your-token>
Severity: warning. Rule name: DocSpade.BearerToken.
Password values
A literal password, secret or key in an example may be copied into real systems or reveal a real one. Use an obvious placeholder.
Avoid: A line that sets a password to a real-looking value.
Use: password=<your-password>
Severity: warning. Rule name: DocSpade.PasswordValues.
Personal emails
Addresses at public mail services belong to real people. Use user@example.com, which is reserved for examples and never delivers mail.
Avoid: An example that uses an address at a public mail service.
Use: Send a message to jane@example.com.
Severity: warning. Rule name: DocSpade.PersonalEmails.
Public IP addresses
Addresses in 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for examples. A real address may point at someone’s server.
Avoid: An example that connects to a real public address.
Use: An example that connects to an address from a documentation range.
Severity: suggestion. Rule name: DocSpade.PublicIPAddresses.
Phone numbers
Numbers in the 555-0100 to 555-0199 range are reserved for fiction. Any other number may belong to a real person.
Avoid: Call 415-867-5309 for support.
Use: Call 415-555-0100 for support.
Severity: suggestion. Rule name: DocSpade.PhoneNumbers.
Social security numbers
A number with three, two and four digits in groups may be a real person’s identifier. Never publish one, even as an example.
Avoid: A line that shows a number in the format of a Social Security number.
Use: SSN: <social-security-number>
Severity: error. Rule name: DocSpade.SocialSecurityNumbers.
Card numbers
Sixteen digits in groups of four is the format of a card number. Use only the test numbers published by the payment provider, and say so.
Avoid: A line that shows sixteen digits in groups of four.
Use: Card: <card-number>
Severity: error. Rule name: DocSpade.CardNumbers.
Example domains
Domains such as mysite.com may be registered by someone, and a request to them leaks data. The names example.com, example.org and example.net are reserved for documentation.
Avoid: curl https://mysite.com/api
Use: curl https://example.com/api
Severity: warning. Rule name: DocSpade.ExampleDomains.
User home paths
A path with a real user name exposes who wrote the example. Use a placeholder such as /Users/<username>/ so that readers see what to replace.
Avoid: A path that contains a real user name.
Use: /Users/<username>/projects/notes.txt
Severity: suggestion. Rule name: DocSpade.UserHomePaths.
Real UUI ds
A real identifier in an example may expose real data, and readers may paste it into their own work. Use an obvious example value or a placeholder such as <resource-id>.
Avoid: A path that contains a real-looking UUID.
Use: GET /articles/<article-id>
Severity: suggestion. Rule name: DocSpade.RealUUIDs.
Draft markers
Markers such as TODO and TBD show that the text is not finished. Finish the section or remove it.
Avoid: A sentence that starts with a to-do marker.
Use: Describe the publishing steps.
Severity: error. Rule name: DocSpade.DraftMarkers.
Draft comments
HTML comments that hold TODO notes can be read by anyone who views the page source.
Avoid: An HTML comment that starts with a to-do marker.
Use: No comment is needed.
Severity: error. Rule name: DocSpade.DraftComments.
Placeholder names
Names such as ‘foo’ and ‘baz’ do not tell readers what to put there. Use a name that fits the example, such as ‘my-site’ or ‘quarterly-report’.
The rule flags terms such as foo, bar, baz, qux, foobar, asdf, qwerty, john doe, jane doe, test test.
Severity: suggestion. Rule name: DocSpade.PlaceholderNames.
Internal only text
Internal markings show that text was copied from a private document. Check that the text may be shared, then remove the marking.
The rule flags terms such as internal use only, confidential, do not distribute, company confidential, internal only, not for external use, proprietary and confidential.
Severity: warning. Rule name: DocSpade.InternalOnlyText.
Was this page helpful?
Powered by Docspade © 2026
