Bài kiểm tra có liên kết hướng dẫn · Cứng Cấp độ

Rủi ro bảo mật của bài kiểm tra mã do AI tạo

Xác định rủi ro trong mã được tạo, xem xét các giới hạn phụ thuộc và tin cậy, tách biệt quá trình thực thi và áp dụng các biện pháp kiểm soát bảo mật.

Đường dẫn hướng dẫn liên quanRủi ro bảo mật của mã do AI tạo
Câu hỏi 1 của 8

An AI-generated SQL query inserts user text directly into a command string. What should the reviewer check?

Xem trước mọi câu hỏi8 câu hỏi

Câu trả lời và giải thích xuất hiện khi bạn làm bài kiểm tra.

  1. An AI-generated SQL query inserts user text directly into a command string. What should the reviewer check?
    • Whether the query has a descriptive variable name
    • Use of parameterized queries and validation for untrusted input
    • Whether the assistant gave a high confidence score
    • Whether the demo used a small database
  2. A generated patch adds a new package with a plausible name. What should happen before adding it to production?
    • Assume the package exists because the import compiles in the answer
    • Copy its name into a deployment script immediately
    • Verify the exact package and assess its maintainer, version and security advisories
    • Disable dependency scanning to avoid warnings
  3. Why is it dangerous for an application to pass model-generated text directly to a shell or privileged API?
    • Unvalidated output could trigger unintended commands or actions
    • The model will always refuse unsafe input
    • A shell cannot run text produced by software
    • Output validation only matters for images
  4. A generated script needs to be tested but its behavior is unfamiliar. What environment is safer?
    • A production server with administrator access
    • A developer laptop containing all personal tokens
    • A shared environment with unrestricted network and file access
    • A sandbox with minimal permissions and no production credentials
  5. A code-scanning tool reports no findings on a generated change. What can the team conclude?
    • The patch is safe against every threat
    • The scanner found no issues within its checks, but this does not prove the code is secure
    • Manual review is unnecessary
    • The code cannot contain logic errors
  6. Which set of controls offers stronger review than relying on the model alone?
    • A request for the model to certify its own code
    • A successful compilation only
    • Code review, tests, dependency and secret scanning, plus threat-model checks
    • A copy of the generated code in a README
  7. Why should an agent have explicit approval before deploying or deleting data?
    • Those actions can have high impact and should remain under accountable human control
    • Approval makes the code compile faster
    • Deployment removes all security vulnerabilities
    • Deleting data is always reversible
  8. A developer wants to protect credentials while asking an AI assistant for help. What is the safest prompt practice?
    • Paste production tokens so the model can test them
    • Include all environment files to avoid missing context
    • Ask the model to remember credentials for the next task
    • Remove secrets and use an approved service with only the necessary code context