Skip to content
Handbook navigation

Chapter 2 · Lab

Lab: What is Artificial Intelligence?

Run this lab

Edit and run the chapter code

Choose an available implementation, change the code, then run it here or continue in the dedicated Labs workspace.

Unlock execution

Output

Run the code to see output here.

Lab 1 - Produce an AI System Classification and Control Brief

Lab ID: VOL1-SEC1-CH2-LAB1

Difficulty: Beginner

Estimated Time: 90 minutes

Objective

Turn an ambiguous request for "an AI policy assistant" into a reviewable system classification, authority boundary, architecture, and failure contract.

Scenario

A global company wants an assistant that can:

  • answer employee questions from internal policies,
  • summarize documents uploaded by an employee,
  • create a support ticket,
  • recommend whether an exception needs specialist review.

The company stores policies in SharePoint and an HR document repository. Permissions vary by country, legal entity, role, and investigation status. Policy owners publish new versions without a synchronized global release.

The assistant must never approve an exception, reveal a document the employee cannot access, or present an unsupported answer as policy.

Prerequisites

  • Complete the Lesson tab.
  • Run either the Python or Java classifier once.
  • Use a diagramming tool or plain Mermaid text for the architecture.

Expected Deliverables

Create one ai-system-brief.md containing:

  1. a one-paragraph system contract,
  2. a six-axis classification table,
  3. a component and trust-boundary diagram,
  4. an authority matrix,
  5. a failure-mode and control table,
  6. an evaluation and release plan,
  7. one architecture decision record.

Task 1 - Write the System Contract

Complete this sentence without naming a vendor or model:

For which employees, the system receives which questions and authorized evidence, uses which inference methods to produce which outputs, may influence which workflow, and falls back to which safe behavior when evidence is missing, conflicting, or unauthorized.

Reject the contract if it does not name users, evidence, output, authority, and fallback.

Task 2 - Classify the System on Six Axes

Complete the table. A row may contain multiple values, but every value needs evidence.

AxisYour classificationEvidence
Field
Method
Model family
Capability
Application
Authority

Then identify two labels that would be misleading. Explain why, for example, "the LLM approves policy exceptions" or "RAG is the model."

Task 3 - Define Sources and Access

Create a source inventory.

SourceOwnerVersion signalAccess ruleFreshness targetConflict behavior
Global policy
Country policy
Employee upload

Decide whether access filtering happens before retrieval, after retrieval, or both. Defend the decision using confidentiality and observability requirements.

Task 4 - Draw the Trust Boundaries

Your diagram must include:

  • employee and identity provider,
  • application orchestrator,
  • permission-aware retrieval,
  • authoritative source repositories,
  • model gateway,
  • citation or claim validator,
  • ticketing tool,
  • human policy owner,
  • evaluation store and telemetry.

Mark where untrusted user content enters, where authorized evidence is selected, where probabilistic output is produced, and where an external side effect can occur.

Task 5 - Build the Authority Matrix

OperationSystem may do automatically?Required controlHuman owner
Retrieve an authorized policy
Draft a cited answer
Summarize an employee upload
Create a support-ticket draft
Submit the ticket
Recommend specialist review
Approve an exceptionNo

The final row must remain No. Explain why model quality and business authority are separate decisions.

Task 6 - Specify Failure Contracts

Complete at least eight rows.

FailureDetection signalImmediate behaviorUser messageOwnerRecovery evidence
No relevant policy found
Two policies conflict
Unauthorized source retrieved
Citation does not support claim
Model timeout
Ticket API unavailable
Harmful instruction in upload
Policy changed after indexing

At least one behavior must be abstain, one must be route to a person, and one must use a deterministic fallback.

Task 7 - Define Evaluation and Release Gates

Create a versioned test set containing:

  • 20 answerable questions with authoritative evidence,
  • 10 questions with no supporting policy,
  • 10 conflicting-policy cases,
  • 10 access-control cases,
  • 10 adversarial or prompt-injection cases,
  • 10 ticket-action cases.

Define metrics and thresholds for answer correctness, citation support, access control, appropriate abstention, tool authorization, latency, and cost. Access control and unauthorized action must have zero tolerated failures in the release set.

Task 8 - Write One ADR

Use this structure:

  • Decision: limit initial authority to answer, summarize, and draft.
  • Context: explain evidence, access, and policy-version uncertainty.
  • Options: direct LLM, retrieval-assisted LLM, deterministic search only.
  • Decision drivers: correctness, traceability, access control, latency, cost.
  • Consequences: name both benefits and operational obligations.
  • Rollback: define how the feature returns to deterministic search.

Verification

Ask another engineer to review the brief without the lesson open. They should be able to answer:

  1. what the model does,
  2. what the application does,
  3. which sources are authoritative,
  4. what the system may not do,
  5. how unsupported output is detected,
  6. who owns every high-impact failure,
  7. what condition blocks or rolls back a release.

If any answer depends on an unstated assumption, revise the brief.

Common Mistakes

MistakeWhy it fails
Calling the whole system an LLMHides identity, retrieval, authorization, validation, and workflow responsibilities
Filtering access only after generationUnauthorized content may already have entered model context or logs
Measuring answer fluencyDoes not establish correctness or citation support
Letting the model decide its own authorityModel output cannot grant application permission
Treating a citation as proofA citation may be irrelevant, stale, or inconsistent with the claim
Using one rollback for every componentSource, index, prompt, model, and tool changes fail differently

Stretch Challenge

Add multi-region residency constraints and a second model provider. Show which data may cross each boundary, how traces remain comparable, and how a provider failover avoids changing the assistant's authority contract.

Success Criteria

The lab is complete when a reviewer can challenge the classification, reproduce the authority decision, trace every answer to authorized evidence, and identify the exact signal and owner for each failure path.

Lab — What is Artificial Intelligence? | KnowledgeOS