Skip to content
The Latent Daily
The Latent Daily

Sections

News & Industry
Knowledge & Learning
Research & Science
Tools, Software & Models
Developers & Builders
Hardware & Infrastructure
Society, Policy & Ethics
AI in Industries
People & Community
Special Formats

Tag

#Security

Security on The Latent Daily: 17 stories, 5 prompts and 8 other resources. Latest: GitHub rulesets and CODEOWNERS for AI-generated pull requests.

30 items

Prompts tagged #Security

Codingadvanced

Post-quantum crypto inventory for a codebase

You are a security engineer helping plan a migration to post-quantum cryptography. Build a cryptography inventory for the code and configuration I provide. System description: [WHAT THE SYSTEM DOES, WHO USES IT, WHERE IT RUNS] Data sensitivity: [WHAT DATA IT PROTECTS AND HOW MANY YEARS IT MUST STAY CONFIDENTIAL] Languages and main crypto libraries: [e.g. "Go with crypto/tls", "Java with Bouncy Castle", "Python with cryptography"] Code and config to review: """ [PASTE FILES, OR A LIST OF FILE PATHS AND SNIPPETS: TLS setup, key generation, signing, JWT handling, certificates, SSH, VPN or database encryption settings] """ Steps: 1. List every place cryptography is used. For each, give: file and line (or config key), the algorithm and key size (RSA-2048, ECDSA P-256, X25519, AES-256-GCM, SHA-256...), its purpose (key exchange, signature, encryption at rest, hashing, password storage) and whether it comes from a standard library or custom code. 2. Classify each use as: QUANTUM-VULNERABLE (RSA, finite-field Diffie-Hellman, elliptic-curve schemes), SIZE-SENSITIVE (symmetric ciphers and hashes, where larger sizes are enough) or NOT AFFECTED. Explain the classification in one line. 3. Rank the quantum-vulnerable uses by risk. Put first anything that protects data which must stay secret for a long time, because encrypted traffic can be recorded now and decrypted later. Signatures on short-lived tokens rank lower. 4. For each high-risk item, suggest a migration path: hybrid key exchange (classical plus ML-KEM) where the library supports it, ML-DSA or SLH-DSA for signatures, and any library upgrade needed. Say "check library support" instead of guessing when you are not sure a version supports it. 5. Flag crypto-agility problems: hard-coded algorithm names, fixed key or signature sizes in database columns or protocols, and custom crypto code that would be hard to swap. 6. End with a table: item, risk (high/medium/low), suggested change, effort (small/medium/large), open questions. Rules: only report what you can see in the material I provided. Do not invent file names, library versions or configuration. If something cannot be determined, write [UNKNOWN] and say what I should check.

Works with: Claude, ChatGPT, Gemini, Any LLM with code access

Codingadvanced

Least-privilege sandbox policy for a coding agent

You are a security engineer who designs sandboxes for AI coding agents. Help me write a least-privilege policy for the agent described below. Assume the agent may make mistakes or try shortcuts, so every permission must be justified by a task. Agent tool and where it runs: [E.G. CODING AGENT IN A LOCAL TERMINAL / CLOUD CONTAINER / CI JOB] Repository or project: [SHORT DESCRIPTION, LANGUAGE, BUILD SYSTEM] Tasks the agent must do: [LIST, E.G. "run unit tests", "install npm packages", "open pull requests"] Tasks the agent must never do: [LIST, E.G. "deploy to production", "read customer data"] Sandbox options available: [E.G. OS SANDBOX, DOCKER, GVISOR, MICROVM, NETWORK PROXY WITH ALLOWLIST] Secrets and credentials that exist in this environment: [LIST WITHOUT VALUES] Produce: 1. Filesystem: paths the agent may read, paths it may write, and paths it must not see. Explain each. 2. Network: a default-deny egress policy plus the smallest allowlist of hosts needed for the listed tasks, with the task each host serves. 3. Credentials: which secrets the agent needs, their minimum scope and lifetime, and which must stay out of the sandbox. 4. Approvals: actions that must stop and ask a human first. 5. Logging and alerts: what to record, and which events should page someone or stop the run. 6. Isolation level: which sandbox option fits, and why a weaker one would not be enough. Rules: - Do not grant any permission that no listed task needs. If a task is ambiguous, ask me instead of guessing. - Mark any setting you are unsure the tool supports as "CHECK DOCS". - End with the three biggest remaining risks and how to test that the policy actually blocks them.

Works with: ChatGPT, Claude, Gemini, Any LLM

Codingintermediate

Dockerfile review for image size, security and build caching

You are a DevOps engineer who reviews container builds. Review the Dockerfile below. Application: [LANGUAGE, FRAMEWORK AND WHAT IT DOES, e.g. "Node 22 API with Express"] Where it runs: [e.g. "Kubernetes", "a single VPS with Docker Compose", "a serverless container platform"] Priorities: [e.g. "smaller image first", "fast CI rebuilds", "security hardening"] Constraints: [e.g. "must use our company base image", "needs native build tools for one dependency"] Dockerfile: """ [PASTE DOCKERFILE] """ .dockerignore (if any): """ [PASTE OR WRITE "none"] """ Please: 1. List findings in a table: line, issue, category (size / caching / security / reliability), severity, fix. 2. Check specifically: base image choice and tag pinning, layer order for cache reuse, dev dependencies in the final image, running as root, secrets passed via ARG or ENV or copied files, missing .dockerignore entries, HEALTHCHECK, and signal handling for graceful shutdown. 3. Rewrite the Dockerfile, using a multi-stage build if it helps, with a short comment on each changed line. 4. Give the commands to build it and to compare image size before and after. 5. Note anything you could not verify without seeing the rest of the repository.

Works with: ChatGPT, Claude, Gemini, Any LLM

Codingadvanced

Lightweight threat model for a new feature

You are an application security engineer running a threat modeling session with a development team. Feature: [WHAT IT DOES, e.g. "users upload a CSV of contacts that we import into their account"] Architecture: [COMPONENTS AND DATA FLOW, e.g. "React frontend -> REST API (Node) -> S3 bucket -> worker -> Postgres"] Users and roles: [e.g. "anonymous visitors, logged-in users, admins"] Sensitive data involved: [e.g. "email addresses, phone numbers", "payment tokens"] Existing controls: [e.g. "OAuth login, rate limiting at the gateway, WAF"] Compliance or constraints: [e.g. "GDPR", "SOC 2", "none"] Produce: 1. Assets: what an attacker would want (data, access, availability, money). 2. Trust boundaries: where data crosses from less trusted to more trusted components. 3. Threats: a table with columns # | Component | STRIDE category (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege) | Threat | Likelihood (L/M/H) | Impact (L/M/H) | Mitigation. 4. Top 5 mitigations to implement first, phrased as backlog items with acceptance criteria. 5. Security tests to add (unit, integration or manual). 6. Assumptions you made and questions for the team. Rules: base threats on the architecture described. If a threat depends on details I did not give, put it under questions instead of assuming the worst or the best.

Works with: ChatGPT, Claude, Gemini

Codingintermediate

Structured code review with a severity checklist

You are a senior [LANGUAGE] engineer doing a code review. Review the code below. Context: - What the code is supposed to do: [PURPOSE] - Where it runs: [e.g. "public web API", "internal batch script"] - Project conventions: [STYLE GUIDE, FRAMEWORK, VERSION] - Focus areas, if any: [e.g. "security", "performance"] Check the code against this list, in order: 1. Correctness: logic errors, edge cases (empty input, null, large values), off-by-one errors. 2. Security: input validation, injection, secrets in code, unsafe deserialization, permissions. 3. Error handling: failures that are swallowed, unclear error messages, missing cleanup. 4. Performance: unnecessary loops, repeated I/O, N+1 queries, memory growth. 5. Readability: naming, function length, duplicated code, missing comments where logic is non-obvious. 6. Tests: what is untested and which test cases you would add. Output format: - A table: # | Severity (blocker/major/minor/nit) | Line(s) | Issue | Suggested fix - Then up to 3 code snippets showing the most important fixes. - Then "What is good": 2-3 things worth keeping. Rules: only report issues you can point to in the code. If something depends on code you cannot see, list it under "Questions for the author" instead of guessing. Code: ``` [PASTE CODE OR DIFF] ```

Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat

Glossary tagged #Security

View all