Skip to content

Commit 4e4302c

Browse files
ci: add Copilot instructions for PII and security review [SVLS-8660]
- Add .github/copilot-instructions.md to steer Copilot auto-review toward security-relevant patterns - Flag PII in log statements: HTTP headers/bodies, user-identifiable fields, secrets — covering all tracing macro forms including unqualified info!/debug!/warn!/error! used via use tracing::{...} - Flag new unsafe blocks with required safety invariant explanation - Flag silently swallowed errors (.ok(), let _ = result) and panicking operations (.unwrap()/.expect()) in network/input paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 672f268 commit 4e4302c

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.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)