14. Safety and teamwork

14 cards

Review this deck
All cards in this deck

Where data in context goes

Everything Claude reads (files, command output, MCP results) is sent to the API; any secret in it should be treated as already sent.

First thing to do after leaking a secret

Revoke and rotate the secret; then check audit logs, clean up, add a blocking layer, report.

Most important secret-blocking layer

Do not keep real secrets in the working directory; only then deny rules, sandbox, hooks.

Indirect prompt injection

Instructions planted in content the agent reads (issues, PR comments, web, README, email, MCP output); the main risk for developers.

Lethal trifecta

Access to private data + reading untrusted content + an outbound channel; cut one factor to sharply reduce risk.

Prompt injection defenses

Least privilege, approve side-effecting actions, restrict network, separate contexts, isolate environments; a warning in the prompt is not a barrier.

Authorization in a tool-using chatbot

Tools check against the authenticated user from the server-side session, not parameters passed by the model.

Slopsquatting

Attackers pre-register package names that models tend to hallucinate; check the registry, source, postinstall, license before installing.

Common security bugs in AI-generated code

SQL/shell string concatenation, userId from the body, disabled TLS, logged tokens, CORS `*` with credentials, ReDoS regexes.

Who is responsible for code Claude writes

The person who commits and the person who approves the merge; do not lower review standards because "AI wrote it".

Org-wide policy banning `bypassPermissions`

Set it in managed settings (e.g. `permissions.disableBypassPermissionsMode`); developers cannot override it.

What to commit in `.claude/`

`settings.json`, `rules/`, `skills/`, `agents/`, hook scripts; do not commit `settings.local.json`, `CLAUDE.local.md`, secrets.

PR workflow with AI

Small PRs, authors self-review and run checks, describe clearly how it was verified, automated review is only an extra layer, never let an agent merge on its own.

Measuring the impact of using Claude

Lead time, escaped defect and revert rate, cost per completed task, experience surveys; avoid counting AI-generated lines of code.

14. Safety and teamwork – Flashcards – Claude | Học Dev