Lesson 9 of 12 intermediate

Code review, security and trust boundaries

AI review সাহায্য করে। কিন্তু permission, data loss আর business rule তুমি evidence দিয়ে যাচাই করবে।

Guess first

Pick an answer. You will see if you were right at the end of the lesson.

Does existence imply access permission?

Open interactive version (quiz + challenge)

Real-world analogy

An inspector checks foundations and exits before choosing paint colours.

What is it?

Review the specification, data flow and tests before style. A diff can compile while leaking another tenant’s data or duplicating a payment. AI review is one input; independent checks and accountable human decisions are still needed.

Real-world relevance

One shared support-ticket product, three optional entry points. Frontend: Review DOM injection, sensitive browser storage and inaccessible error states. Backend: Review authorisation, schema validation, transaction boundaries and log redaction. Mobile: Review device storage, exported components, permissions and API credentials.

Key points

Quick check

Answer from memory — scrolling up first makes it stick less.

What artifact demonstrates this lesson?

Which statement is defensible?

Code example

def can_read_ticket(session, ticket):
    return (session["authenticated"]
            and session["tenant_id"] == ticket["tenant_id"]
            and session["user_id"] == ticket["owner_id"])

Line-by-line walkthrough

  1. 1. Python: both tenant and owner are checked. This simple private-ticket policy must change explicitly if a reviewed role-based sharing requirement is introduced.

Spot the bug

if ticket_exists(id): return ticket
Need a hint?
Does existence imply access permission?
Show answer
Check authenticated tenant and ownership before returning ticket data.

Explain like I'm 5

AI review সাহায্য করে। কিন্তু permission, data loss আর business rule তুমি evidence দিয়ে যাচাই করবে।

Fun fact

A useful artifact for this lesson: Follow input through validation, authorisation, storage and response.

Hands-on challenge

Choose ONE stack; you do not need to build all three. Junior foundation: Trace a single input from client to storage and find one missing check. Senior extension: Review permission boundaries and failure paths independently of generated tests. Evidence: save the input, expected behaviour, actual result and one failure or limitation. Junior means basic coding and Git, not zero programming experience.

More resources

Open interactive version (quiz + challenge) Download the whole course as PDF / Word

Lock it in

← Back to course: AI-Assisted Software Engineering