Skip to content

Commit e3c16ed

Browse files
ci: add Copilot instructions for PII and security review (#109)
Adds .github/copilot-instructions.md to guide GitHub Copilot auto-review toward security-relevant patterns on every PR: PII in log statements, unsafe Rust blocks without invariant documentation, and silently swallowed errors in network/external-input code paths. Jira: https://datadoghq.atlassian.net/browse/SVLS-8660 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 05e5c26 commit e3c16ed

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/copilot-instructions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copilot Code Review Instructions
2+
3+
## Security — PII and Secrets
4+
5+
Flag any logging statements (`log::info!`, `log::debug!`, `log::warn!`, `log::error!`,
6+
`tracing::info!`, `tracing::debug!`, `tracing::warn!`, `tracing::error!`, or unqualified
7+
`info!`, `debug!`, `warn!`, `error!` macros (e.g., via `use tracing::{info, debug, warn, error}`))
8+
that may log:
9+
- HTTP request/response headers (Authorization, Cookie, X-API-Key, or similar)
10+
- HTTP request/response bodies or raw payloads
11+
- Any PII fields (e.g., email, name, user_id, ip_address, phone, ssn, date_of_birth)
12+
- API keys, tokens, secrets, or credentials
13+
- Structs or types that contain any of the above fields
14+
- `SendData` values or any variable that contains a `SendData` object (e.g.,
15+
`traces_with_tags` or similar variables built via `.with_api_key(...).build()`),
16+
since these embed the Datadog API key
17+
18+
Suggest redacting or omitting the sensitive field rather than logging it.
19+
20+
## Security — Unsafe Rust
21+
22+
Flag new `unsafe` blocks and explain what invariant the author must uphold to make the
23+
block safe. If there is a safe alternative, suggest it.
24+
25+
## Security — Error Handling
26+
27+
Flag cases where errors are silently swallowed (empty `catch`, `.ok()` without
28+
handling, `let _ = result`) or where operations like `.unwrap()`/`.expect()` may panic,
29+
in code paths that handle external input or network responses.

0 commit comments

Comments
 (0)