Security and Ethics
Protect sensitive information, verify generated code, and consider the people affected by AI-assisted work.
AI assistance does not change the team’s duty to protect users, company information, and production systems. Generated code crosses the same review gates as any other code and may require additional scrutiny because its origin and assumptions are less visible.
Protect the input
Use the company’s data classification and approved-tool policy. Unless a tool and use case are explicitly approved, do not send:
- credentials, tokens, private keys, cookies, or environment files;
- customer records, personal data, payment data, or private communications;
- production logs, incident evidence, internal addresses, or vulnerability details;
- proprietary source code or documents outside the allowed scope; or
- third-party material the company is not allowed to share.
Sanitizing means removing or replacing sensitive values, not merely asking the model to ignore them. If a secret is exposed, follow the incident path and rotate it; deleting the conversation is not sufficient.
Treat output as untrusted input
AI-generated code can contain familiar vulnerabilities or disable a protection to make a test pass. Review trust boundaries explicitly:
- authentication and authorization on every server action;
- runtime input validation, bounds, and safe defaults;
- parameterized database access and safe subprocess arguments;
- output encoding, sanitized rich text, and constrained URLs;
- SSRF, file paths, redirects, uploads, and deserialization;
- secret handling, logs, error messages, and browser bundles;
- concurrency, retries, idempotency, timeouts, and resource limits; and
- dependency provenance, version support, license, and advisories.
Never install a suggested package until its registry entry, publisher, source repository, maintenance state, license, and exact version have been verified. A plausible package name may not exist—or may belong to an attacker.
Keep human responsibility
| Do | Do not |
|---|---|
| Attribute sources and respect licenses | Present generated text as verified research |
| Assess privacy, accessibility, and harmful bias | Assume a fluent answer treats people fairly |
| Keep a human owner for user-impacting decisions | Delegate hiring, discipline, access, or safety decisions blindly |
| Explain material limitations and uncertainty | Hide AI use when policy or trust requires disclosure |
| Provide a correction and appeal path | Make an automated judgment impossible to challenge |
An engineer should be able to explain who may be affected, what data is used, how errors are detected, and who can stop or correct the system. Efficiency is not a reason to remove dignity, privacy, accessibility, or accountability.
Release gate
Before merging AI-assisted work, confirm:
- The change has a named human owner and reviewer.
- Sensitive inputs stayed within approved boundaries.
- The author understands the complete diff.
- Security and dependency checks match the risk.
- Tests cover success, denial, malformed input, and important failure paths.
- Logs and metrics can reveal harmful or incorrect behavior.
- Rollback or containment is practical.