
Choose a workflow worth automating. Every successful enterprise AI system starts with a well-chosen workflow, and this lecture shows you how to pick one that is valuable, feasible and safe to automate before you write any code.
We begin with the selection criteria. A good candidate is frequent, repetitive and costly in human time, has clear inputs and outputs, draws on data you are allowed to use, and has a measurable definition of success. We contrast it with poor candidates, such as workflows with vague goals, high-stakes irreversible actions, or no reliable source of truth. Throughout the course we use an enterprise support copilot as the running example, so you will see why support triage and answer drafting make a strong first choice.
You will learn to describe a workflow in concrete terms: who starts it, which systems it touches, what decisions are made, where a human must stay involved, and what failure would cost. We also introduce a simple scoring worksheet that compares candidates on value, risk, data readiness and effort.
The lecture emphasizes observable behavior over hype. A workflow is only worth automating if you can later test whether the automation helped.
By the end of this lecture you will be able to evaluate candidate workflows, justify your choice to stakeholders, and write a short workflow statement that anchors the rest of your architecture work.
Map enterprise systems and trust boundaries. Once a workflow is chosen, you need to understand every system it touches and where trust changes. This lecture teaches you to map enterprise systems and draw trust boundaries so that later design decisions about access, validation and logging rest on a clear picture.
We start by inventorying the components in a typical enterprise AI workflow: identity provider, document stores, relational databases, SaaS applications, the application service, the model provider, caches and observability tools. For each one you note who owns it, what data it holds, how it authenticates callers and what it can do.
Next we introduce trust boundaries, the lines where data or control passes between parties with different privileges. User input, retrieved documents, model output and third-party API responses all cross boundaries, and each deserves different levels of trust. We explain why model output and retrieved text should be treated as untrusted until validated.
You will practice drawing a simple data flow diagram and annotating it with boundaries, credentials and data classifications. These diagrams become the basis for later threat modeling and access-control design.
By the end of this lecture you will be able to produce a clear system map, identify where validation and authorization must occur, and explain the reasoning behind each boundary to engineers and security reviewers.
Separate deterministic logic from model decisions. A common mistake in AI systems is asking a model to do work that ordinary code does better. This lecture explains how to divide responsibility between deterministic logic and model-driven decisions so that your system is predictable, testable and cheaper to run.
Deterministic logic is appropriate whenever rules are explicit and must always hold, such as permission checks, arithmetic, date handling, status transitions, schema validation and policy enforcement. Models are appropriate where language understanding, summarization, classification of fuzzy input or flexible drafting is needed. We discuss how to recognize the boundary and how to design interfaces so that the model proposes and code decides.
You will see examples from the support copilot. Deciding whether a customer is entitled to a refund belongs in code that reads authoritative data, while drafting a polite explanation can use a model. We also cover fallback paths when the model is unavailable or uncertain.
This separation makes testing easier, because deterministic components can be covered by conventional unit tests while model components use evaluation datasets. It also limits the blast radius of model errors.
By the end of this lecture you will be able to decompose a workflow into rule-based and model-based steps, define the contract between them and defend the design in an architecture review.
Define quality, latency, and cost targets. An enterprise AI system needs measurable goals before anyone can say whether it works. This lecture shows you how to define quality, latency and cost targets that are specific, testable and agreed with stakeholders.
We start with quality. Instead of vague goals like accurate answers, you define task-specific measures such as the share of answers supported by cited evidence, the rate of correct abstention, the accuracy of classification and the proportion of actions that pass validation. We discuss choosing thresholds based on business impact and baseline human performance.
Next is latency. You will learn to set end-to-end targets, such as a percentile response time, and to split them into budgets for retrieval, model calls, tool execution and post-processing. Cost targets cover per-request token spend, infrastructure and review effort, and they need ceilings as well as averages.
We also discuss how targets interact. Higher quality may require more retrieval or a larger model, which raises latency and cost, so the team must make explicit tradeoffs.
You will write targets in a simple table that later feeds evaluation gates and release criteria.
By the end of this lecture you will be able to define practical, measurable service-level targets, explain the tradeoffs among them and use them to guide design decisions.
Design the enterprise AI reference architecture. In this lecture you bring together the workflow, system map, responsibility split and targets into a coherent reference architecture for the enterprise support copilot, which serves as the blueprint for the rest of the bootcamp.
We walk through the layers. Clients and an API gateway handle requests. An application service enforces identity and tenant context. A retrieval layer searches authorized documents. A database access layer provides scoped queries. A model adapter calls the provider through a narrow interface. A tool layer validates and executes approved actions. Observability, evaluation and governance components surround the whole system.
For each layer we discuss responsibilities, interfaces, failure modes and ownership. You will see why narrow adapters and explicit contracts make it easier to swap providers, test with deterministic doubles and trace behavior. We also place the trust boundaries identified earlier onto the diagram.
We then cover documentation. A good reference architecture includes a diagram, a component table, key decisions with rationale, known risks and open questions, so reviewers can challenge it constructively.
The architecture is intentionally provider neutral, and the labs use local deterministic adapters instead of paid services.
By the end of this lecture you will be able to present an enterprise AI reference architecture, explain how each component supports quality, security and operability, and identify decisions that need further validation.
Hands-on Lab: Architecture review. In this lab you review a provided draft architecture for the enterprise support copilot and produce a written assessment that identifies strengths, gaps and recommended changes. The lab uses synthetic documentation and runnable Python helpers with reproducible test cases, so no paid AI services are required.
You receive a sample architecture description, a system diagram in text form and a short list of requirements. The steps I would expect you to follow are these. First, restate the workflow and targets in your own words. Second, list each component and mark where trust boundaries sit. Third, check whether deterministic logic and model decisions are properly separated. Fourth, look for missing controls such as tenant context, validation, logging and rollback. Fifth, compare the design against the quality, latency and cost targets. Sixth, write prioritized recommendations with an owner and rationale for each.
The accompanying checks help you confirm that your findings are consistent, for example by verifying that every data flow crossing a boundary has a stated control. You will also practice a short role-play, explaining your top three concerns to a non-technical stakeholder.
By the end of this lab you will have a structured architecture review document, a prioritized remediation list and greater confidence in challenging designs before implementation begins.
Structure a maintainable Python service. A prototype script is not an enterprise service. This lecture shows how to structure a Python service so that it remains readable, testable and safe to change as the support copilot grows.
We begin with project layout. Separate the API layer, domain logic, adapters for external systems, configuration and tests into clear modules. Keep business rules independent of web frameworks and model providers so they can be tested without network access. We discuss dependency injection as a simple way to pass adapters into services, which lets tests substitute deterministic doubles.
Next we cover typing and conventions. Type hints, data classes or validation models, explicit return types and consistent error classes make behavior easier to reason about. We discuss structured logging, small functions, clear naming and avoiding hidden global state.
We also introduce packaging basics, pinned dependencies and a standard way to run tests and linters, since these habits support later continuous integration work.
The examples are runnable and use synthetic data, with no dependence on paid AI services.
By the end of this lecture you will be able to organize a Python AI service into well-defined layers, apply dependency injection for testability and follow conventions that make the codebase maintainable by a team.
Validate request and response contracts. Every boundary in an enterprise AI system needs a contract that says what is allowed in and what will come out. This lecture explains how to define and enforce request and response contracts in Python so that bad data is rejected early and callers get predictable behavior.
We start with request validation. You will define schemas that specify required fields, types, lengths, allowed values and nested structures, and you will reject anything that does not conform before it reaches business logic or a model. We discuss why validation should be strict by default, and how to return clear, safe error messages that do not leak internals.
Next are responses. Contracts for outgoing data protect clients and downstream systems from surprises, and they make versioning manageable. We cover optional versus required fields, backward-compatible changes and explicit error formats.
We also connect contracts to testing. Contract tests confirm that the service accepts valid examples, rejects invalid ones and keeps responses stable across releases.
You will work with runnable examples built on synthetic data and reproducible test cases.
By the end of this lecture you will be able to model request and response schemas, enforce them at service boundaries, and write tests that protect those contracts as the system evolves.
Separate configuration from secrets. Enterprise services depend on settings and credentials, and mixing them creates operational and security problems. This lecture shows how to separate ordinary configuration from secrets and load both in a controlled, testable way.
We begin with the distinction. Configuration includes values such as timeouts, feature flags, model names and endpoint addresses, which can be stored in version control or environment-specific files. Secrets include API keys, tokens and passwords, which must never be committed, logged or included in error messages. We explain why mixing them makes review, rotation and incident response harder.
You will learn patterns for loading settings: typed configuration objects, validation at startup so the service fails fast on missing values, environment variables for deployment-specific values, and secret managers for sensitive material. We discuss defaults, overrides and how to keep local development safe with fake values.
We also cover redaction. Configuration objects should avoid printing secrets, and logging helpers should mask sensitive fields.
The labs use synthetic placeholders and local adapters, so no real credentials are needed.
By the end of this lecture you will be able to design a clean configuration layer, keep secrets out of code and logs, and explain how rotation and environment separation reduce risk in enterprise deployments.
Set deadlines and propagate cancellation. AI workflows call slow and sometimes unreliable dependencies, and without deadlines a single stuck call can exhaust resources. This lecture explains how to set deadlines and propagate cancellation through a Python service.
We start with the problem. A request that waits indefinitely on a model, database or SaaS API ties up workers, increases cost and degrades every other user. Timeouts at each call are necessary but not sufficient, because the total request also needs an overall budget.
You will learn to model a deadline as part of request context, calculate remaining time before each downstream call and pass that budget along. We discuss how asynchronous code supports cancellation, how to handle cancellation cleanly by releasing resources, and how to avoid leaving partial work that causes inconsistent state.
We also cover what to return when time runs out: a clear, bounded error or a safe degraded response, never an unbounded wait.
The connection to earlier lessons is direct. The latency targets you defined become enforceable deadlines in code.
The examples are runnable, use deterministic local adapters and include tests that simulate slow dependencies.
By the end of this lecture you will be able to implement deadline propagation, handle cancellation safely and test timeout behavior without relying on real network delays.
Test model adapters with deterministic doubles. Model providers are slow, costly and non-deterministic, which makes them a poor foundation for repeatable tests. This lecture shows how to hide the provider behind an adapter interface and test your service with deterministic doubles.
We begin with the adapter pattern. Your application depends on a small interface, such as a function that accepts a structured request and returns a structured result, and the real provider implementation sits behind it. This keeps provider specifics out of business logic and makes switching providers realistic.
Next are test doubles. A fake adapter can return canned responses for known inputs, simulate errors, delay responses, return malformed output or emit unexpected content. You will use these to verify that your service handles success, timeouts, invalid output and retries correctly, all in milliseconds and at no cost.
We also explain the limits. Doubles prove your code behaves correctly given certain model behavior, but they do not prove model quality. That is the job of evaluation datasets, which come later in the course.
The labs rely on runnable Python examples with reproducible cases and no paid services.
By the end of this lecture you will be able to design clean model adapters, write deterministic tests for error and edge cases and distinguish code correctness from model quality.
Hands-on Lab: Service contract. In this lab you build a small Python service skeleton for the support copilot, with explicit request and response contracts, a configuration layer, deadline handling and a deterministic model adapter. Everything uses synthetic data and local adapters, so no paid AI services are needed.
The steps I would expect you to follow are these. First, create the module layout with separate API, domain, adapter and configuration packages. Second, define typed request and response schemas, including validation rules and a standard error format. Third, load configuration from environment values while keeping placeholder secrets out of source files. Fourth, add a deadline object that is passed to the adapter call and enforced with a timeout. Fifth, implement a fake model adapter that can return valid output, invalid output and delays. Sixth, write tests that cover valid requests, rejected requests, timeouts and malformed adapter responses.
Reproducible test cases let you check your work against expected results. You will also complete a short role-play in which you explain your contract choices to a reviewing stakeholder.
By the end of this lab you will have a tested service skeleton with enforceable contracts, a pattern you can reuse and extend throughout the remaining weeks of the bootcamp.
Inventory structured and unstructured sources. Before an AI system can use enterprise data, you must know what data exists, where it lives and how it can be accessed. This lecture shows how to build an inventory of structured and unstructured sources for the support copilot.
Structured sources include relational databases, data warehouses and SaaS records, where data has defined fields and types. Unstructured sources include documents, wiki pages, tickets, email threads and PDFs, where meaning lives in text and layout. Each type brings different extraction, quality and access challenges.
You will learn what to record for each source: owner, system of record, data classification, access method, refresh pattern, volume, known quality issues, retention rules and legal constraints. We discuss how to decide which sources are authoritative for each kind of fact, so that the model never has to guess between conflicting versions.
We also cover prioritization. Not every source is worth integrating at first, so you weigh business value against sensitivity and effort.
The result is a living register that feeds later work on schemas, lineage, retention and authorization.
By the end of this lecture you will be able to create a practical data source inventory, identify authoritative sources and justify which ones to connect first.
Define schemas and source ownership. Data contracts begin with clear schemas and named owners. This lecture explains how to define schemas for enterprise records and documents and how to assign ownership so that someone is accountable when data changes.
We start with schema design. For structured data, define field names, types, nullability, allowed values and relationships. For documents, define a normalized record that captures an identifier, source system, version, title, body, timestamps, access labels and tenant information. Consistent schemas let downstream retrieval, evaluation and authorization code work across many sources.
Next is ownership. Each source needs a responsible team that approves schema changes, answers quality questions and communicates incidents. We discuss data contracts as agreements between producers and consumers, including change notification, versioning rules and compatibility expectations.
You will see how to represent schemas in Python with typed models and how to write tests that detect breaking changes, such as renamed fields or altered types.
All examples use synthetic data and reproducible test cases.
Review the schemas with both producers and consumers before publishing them, because early agreement on names, types and change rules prevents expensive surprises later in the pipeline.
By the end of this lecture you will be able to design clear schemas for enterprise records, document ownership and change processes, and use automated checks to protect consumers from unexpected upstream changes.
Validate and quarantine malformed records. Real enterprise data is messy, and silently ingesting bad records corrupts retrieval and answers. This lecture explains how to validate incoming records and quarantine those that fail, so that problems are visible and recoverable.
We begin with validation layers. Structural checks confirm required fields and types. Semantic checks confirm values make sense, such as dates in a valid range or identifiers in expected formats. Policy checks confirm records carry the access labels and tenant information needed for authorization. Content checks look for empty bodies, unusual encodings and oversized files.
When a record fails, the system should not drop it quietly or let it through. Instead it moves to a quarantine area with the reason, source, timestamp and original payload, so owners can review and fix it. We discuss reporting, alerting thresholds and a replay process for corrected records.
We also address the balance between strictness and availability. Some failures should block a batch, while others should only isolate the offending record.
The labs use synthetic data with deliberately malformed examples and reproducible tests.
By the end of this lecture you will be able to build validation pipelines, design a quarantine workflow and report data quality in a way that supports accountable remediation.
Track lineage and document versions. When an answer cites a document, you need to know exactly which version it came from and how it got there. This lecture explains lineage tracking and document versioning for enterprise AI systems.
Lineage records the path of a piece of data from its source through each transformation to the place where it is used. For a retrieval system, this means linking each chunk back to its document, version, source system and ingestion run. Versioning means every change to a source document creates a new identifiable version, rather than overwriting history.
You will learn what metadata to store: source identifiers, content hashes, version numbers, timestamps, processing steps, and the schema version used. We discuss how hashes detect real changes, how to mark superseded versions, and how to keep old versions available for audit when policy requires it.
These practices support later goals. Citations can bind to specific versions, evaluation results can be reproduced, and deletions can propagate to every derived artifact.
The examples are runnable, built on synthetic documents, and include tests that confirm lineage links stay intact.
By the end of this lecture you will be able to design lineage metadata, implement versioned document records and explain how they support trust, reproducibility and auditability.
Design retention and deletion propagation. Enterprise data does not live forever, and when it must be deleted, every copy must go. This lecture explains how to design retention rules and deletion propagation across the many derived stores in an AI system.
We start with retention. Different data classes have different required or permitted lifetimes, driven by legal, contractual and business needs. You will learn to express retention rules as policy attached to records, such as keep for a number of days, delete on request, or hold for legal reasons.
Next is propagation. A single source document may produce chunks, embeddings, cached answers, traces, evaluation snapshots and backups. A deletion that removes only the original leaves the rest behind. We map the derived artifacts for the support copilot and design a process that finds and removes each one, records evidence of completion and handles failures with retries.
We also discuss tombstones, delays caused by backups, and how to verify deletion through tests.
Provider retention matters too. You must understand what external services keep and how to request or configure deletion.
All examples use synthetic data and reproducible tests.
By the end of this lecture you will be able to design retention policies, trace derived data and implement and verify deletion propagation across your AI pipeline.
Hands-on Lab: Data contract. In this lab you create a data contract for the support copilot that covers source inventory, schemas, validation, quarantine, lineage and deletion. It uses synthetic data and runnable Python with reproducible test cases, and requires no paid AI services.
The steps I would expect you to follow are these. First, complete an inventory of the provided sample sources, marking owners, classifications and authoritative systems. Second, define typed schemas for a structured record and a document record, including version and access label fields. Third, write validation rules and route failing records into a quarantine store with a reason code. Fourth, add lineage metadata so each derived chunk links back to its source version. Fifth, implement a deletion function that removes a document and all derived artifacts, then record evidence. Sixth, run the provided tests to confirm that malformed records are isolated and deletions are complete.
You will also complete a short role-play explaining the contract to a data owner who is concerned about added validation effort.
Keep the contract in version control alongside the tests, so that any proposed change to a schema or retention rule is reviewed and verified before it reaches the shared environment.
By the end of this lab you will have a working data contract package, tests that protect it and a clear way to discuss data responsibilities with source owners.
Model tenants and business entities. Multi-tenant enterprise systems serve many customers or business units from shared infrastructure, and the database model is where isolation begins. This lecture shows how to model tenants and business entities so that every record is clearly owned and every query can be scoped.
We start with the tenant concept. A tenant might be a customer organization, a business unit or a region, and every row that belongs to one should carry a tenant identifier that is set at creation and never changed casually. We discuss how this identifier appears in primary and foreign keys, indexes and uniqueness constraints, so that two tenants can safely use the same ticket number or account name.
Next, we model the entities of the support copilot: customers, users, tickets, products, entitlements and knowledge articles. You will learn to define relationships, enforce them with constraints and capture ownership and status fields that later policies depend on.
We also cover schema evolution, migrations and the importance of testing that constraints really prevent invalid combinations.
The examples use a small local database with synthetic data and reproducible tests.
By the end of this lecture you will be able to design a tenant-aware relational model, express business entities and relationships clearly and prepare the schema for scoped queries and row-level policies.
Use parameterized queries and scoped credentials. When an AI workflow touches a database, the way queries are built and the privileges they run with decide how much damage a mistake can cause. This lecture explains parameterized queries and scoped credentials as two basic safeguards.
Parameterized queries separate the SQL structure from the values supplied at runtime. The database treats values strictly as data, never as part of the command, which prevents a whole category of injection mistakes and also improves plan reuse. We discuss why string concatenation is never acceptable for values that come from users, models or documents, and how to handle dynamic parts such as sort columns through fixed allowlists.
Scoped credentials limit what the connection can do. Rather than one powerful account, use separate accounts or roles for read and write paths, restrict them to the tables and columns required and avoid administrative rights in application code. We cover secret handling, rotation and per-environment credentials.
We also explain why a model should never write raw SQL that is executed directly with broad rights.
The labs use a local database, synthetic data and tests that confirm hostile-looking input is treated only as data.
By the end of this lecture you will be able to write safe parameterized queries and configure least-privilege database roles for AI services.
Apply row-level policies and test isolation. Even careful application code can forget a filter, so the database should enforce tenant boundaries too. This lecture explains row-level security policies and shows how to test that isolation actually holds.
We begin with the idea. A row-level policy attaches a rule to a table so that each query only sees rows the current session is entitled to, usually based on a tenant identifier set from verified identity. Because the rule lives in the database, a missing filter in application code does not automatically expose other tenants.
You will learn how to define policies for reading and writing, how to set session context safely for each request, and how to avoid common pitfalls such as connection pooling that leaks context between requests, administrative roles that bypass policies and views that sidestep rules.
Then we focus on testing. Isolation tests create data for two tenants, run the same operations as each and assert that no row, count or error message reveals the other tenant. These tests belong in the regular suite and in release checks.
The examples use a local database with synthetic data and reproducible cases.
By the end of this lecture you will be able to implement row-level policies and write convincing isolation tests.
Bound query time and result size. A single unbounded query can slow a database for everyone, and an unbounded result can overwhelm memory or an AI context window. This lecture explains how to put sensible limits on query time and result size.
We start with time limits. Set statement timeouts at the database or session level, align them with the request deadline from earlier lectures, and handle timeout errors gracefully by returning a clear, bounded response rather than retrying blindly.
Next are result limits. Use explicit row caps, pagination with stable ordering and keyset approaches for large tables. Select only the columns needed, since extra fields increase cost, latency and the chance of exposing something unintended. We also discuss aggregation and summarization performed inside the database instead of fetching large raw sets.
Cost awareness matters as well. Explain plans and indexes help you detect queries that scan too much, and monitoring slow queries gives early warning.
For AI workflows, limits also protect the model boundary, because oversized data wastes tokens and can bury the evidence that matters.
The labs use a local database, synthetic data and tests that verify limits are enforced.
By the end of this lecture you will be able to set time and size bounds, paginate safely and explain how limits protect reliability, cost and security.
Design a safe analytics query interface. Users often want to ask data questions in natural language, which tempts teams to let a model write SQL. This lecture shows a safer way to design an analytics interface for enterprise AI.
We start with the risks of open-ended generation: queries touching unauthorized tables, expensive scans, writes disguised as reads and results that leak across tenants. Instead of executing model-written SQL directly, we design a constrained interface.
One approach is a catalog of approved query templates with typed parameters. The model selects a template and proposes parameters, and deterministic code validates them against allowed values, applies tenant scope and runs the parameterized query with limits. Another approach uses a restricted query builder that only permits approved tables, columns, filters and aggregations, with a validator rejecting anything else.
We discuss audit records that capture who asked, what was run and what was returned, along with explanations to users about what data was used. We also discuss when to refuse or ask a clarifying question.
The labs use synthetic data, a local database and tests that probe the validator with unusual but harmless inputs.
By the end of this lecture you will be able to design an analytics interface that gives useful answers while keeping access, cost and tenant boundaries under deterministic control.
Hands-on Lab: Database boundary. In this lab you build and test a tenant-safe database layer for the support copilot, using a local database with synthetic data and runnable Python. No paid AI services are required.
The steps I would expect you to follow are these. First, create tables for tenants, users, tickets and articles with tenant identifiers and constraints. Second, implement data access functions that use only parameterized queries and a read-only role. Third, add row-level policies and set the session tenant from a verified context value. Fourth, apply statement timeouts and row limits, with pagination for larger sets. Fifth, build a small analytics interface based on approved templates and a validator for parameters. Sixth, write tests that confirm cross-tenant reads return nothing, timeouts are enforced, limits hold and invalid parameters are rejected.
Reproducible test cases let you compare results with expected outputs. You will also complete a role-play explaining to a product manager why some analytics requests are refused or constrained.
Keep the layer small and well documented, since a clear boundary is easier to review, test and defend than scattered query code spread across many modules.
By the end of this lab you will have a tested database boundary with isolation evidence, a pattern you can reuse for other data sources and a clearer vocabulary for discussing data access risks with stakeholders.
Distinguish users, workloads, and service accounts. Identity is more than a login screen. This lecture explains the different kinds of identities in an enterprise AI system and why keeping them distinct is essential for security and accountability.
A user identity represents a person acting through an interface, with attributes such as tenant, roles and group membership. A workload identity represents running software, such as the application service or an ingestion job, and is issued by the platform to prove which workload is calling. A service account is a long-lived non-human account, often used for integrations, which requires careful ownership, rotation and scope.
We discuss why sharing one credential across many components blurs audit trails and expands the damage of any leak. Each component should have its own identity with the minimum permissions it needs, and every action should be attributable to either a user, a workload or a delegated combination.
You will see how this applies to the copilot: a user asks a question, the service acts with its own identity and, when needed, on behalf of the user with explicitly limited delegation.
The material is conceptual with small runnable examples using synthetic identities.
By the end of this lecture you will be able to classify identities, assign appropriate permissions and describe how identity design supports least privilege and auditing.
Understand OAuth authorization and OIDC identity. OAuth and OpenID Connect are the standard building blocks for enterprise sign-in and delegated access, and they are often misunderstood. This lecture clarifies what each does and how they fit together.
OAuth is about authorization: it lets an application obtain limited access to a resource on behalf of a user, using access tokens with defined scopes. OpenID Connect adds an identity layer on top, issuing an ID token that tells the application who authenticated and how. Confusing the two is a common source of mistakes, such as treating an access token as proof of identity.
We explain the main participants: the user, the client application, the authorization server and the resource server. We walk conceptually through the authorization code flow with PKCE for user-facing applications and the client credentials flow for workload-to-workload calls, noting when each is appropriate.
You will learn the vocabulary of scopes, claims, consent, refresh tokens and token lifetimes, and why short-lived tokens reduce exposure.
The examples use a local, synthetic identity provider simulation, so you can inspect token contents without real accounts.
By the end of this lecture you will be able to explain OAuth and OIDC clearly, choose appropriate flows and avoid common conceptual mistakes when integrating identity into an AI service.
Validate token signature, issuer, audience, and expiry. Receiving a token is not the same as trusting it. This lecture explains the checks a service must perform before accepting a token and why skipping any of them creates risk.
We begin with the signature. A signed token proves it was issued by a party holding the signing key, so your service verifies it using the issuer's published keys, restricts accepted algorithms and handles key rotation by refreshing the key set safely. Next is the issuer claim, which must match the authorization server you trust. The audience claim must match your service, so a token meant for another API cannot be replayed against yours. Expiry and not-before times must be enforced with a small, controlled clock tolerance.
We also check scopes or roles required for the operation, confirm the token type and treat missing claims as failures. Error responses should be consistent and avoid revealing validation details to callers.
You will learn how to centralize validation in one well-tested component, rather than scattering checks across handlers.
The labs use locally generated test keys and synthetic tokens, with test cases for valid, expired, wrong-audience and tampered tokens.
By the end of this lecture you will be able to implement complete token validation, test failure cases and explain why each check matters.
Handle sessions and credential rotation. Long-running AI conversations and background jobs need identities that persist safely over time. This lecture covers session handling and credential rotation in enterprise AI services.
We start with sessions. A session ties a series of requests to an authenticated user, and its lifetime, storage and renewal rules matter. Use secure, short-lived session identifiers or tokens, bind them to the right tenant and user, support logout and revocation, and avoid storing sensitive data in places where users or the model can read it. We discuss refresh tokens, idle and absolute timeouts, and what should happen when a user's access changes mid-session.
Next, credential rotation. Secrets such as client secrets, signing keys and database passwords should be replaced regularly and immediately after suspected exposure. We explain overlap periods where old and new values both work, automated rotation through secret managers and how services reload credentials without restarts or dropped requests.
We also cover monitoring for unusual credential use and documenting a revocation runbook.
The labs use synthetic credentials and local simulations to practice rotation safely, with tests that confirm old credentials stop working on schedule.
By the end of this lecture you will be able to design session behavior, implement rotation patterns and describe how both reduce the impact of credential compromise.
Model delegated access without copying user passwords. Many useful AI features act on a user's behalf, such as reading their calendar or updating a ticket, and the safe way to do this is delegation, never password sharing. This lecture explains how to model delegated access.
We begin with the anti-pattern. Asking users to give their password to an application or storing it for later use creates enormous risk, breaks multi-factor protections and makes revocation difficult. Delegation protocols exist to avoid this.
You will learn how consent and scoped tokens work. The user approves specific permissions, the authorization server issues a token limited to those scopes and the application uses it for the permitted actions only. We cover token exchange and on-behalf-of patterns, where a service obtains a narrower token for a downstream API, preserving the user's identity and limits.
Design guidance includes requesting only needed scopes, storing tokens securely and encrypted, honoring revocation, logging delegated actions with both the user and the application identity and expiring access when it is no longer needed.
The examples run against a local simulated provider with synthetic users.
By the end of this lecture you will be able to model delegated access correctly, explain it to non-specialists and design AI features that act for users without ever handling their passwords.
Hands-on Lab: Identity design. In this lab you design and test the identity layer for the support copilot, using a local simulated identity provider, synthetic users and runnable Python. No paid AI services or real accounts are needed.
The steps I would expect you to follow are these. First, list the identities in the system and classify each as a user, workload or service account, noting the permissions each should hold. Second, write a token validator that checks signature, issuer, audience, expiry and required scopes. Third, create test tokens for valid, expired, tampered and wrong-audience cases and confirm the validator responds correctly. Fourth, implement a simple session model with idle and absolute timeouts and revocation. Fifth, practice a credential rotation with an overlap period. Sixth, document a delegated access flow for a downstream SaaS call, showing scopes and logging fields.
Reproducible tests confirm your validator rejects every invalid token. You will also complete a role-play in which you explain to a security reviewer why the design avoids shared credentials and stored passwords.
Store the validator tests and rotation notes next to the design document, so that a reviewer can trace every claim in the design to a test that demonstrates it.
By the end of this lab you will have a tested identity design, evidence of correct validation and a reusable foundation for the authorization work in the next section.
Translate roles and attributes into policies. Authentication tells you who someone is, while authorization decides what they may do. This lecture explains how to translate business roles and user attributes into clear, testable authorization policies.
We begin with models. Role-based access control assigns permissions to roles such as agent, manager or auditor. Attribute-based access control evaluates attributes of the user, the resource and the context, such as department, ticket sensitivity or region. Many enterprise systems combine both, using roles for broad access and attributes for fine-grained limits.
You will learn how to gather requirements from business owners, express them as explicit rules and avoid ambiguity. We discuss deny-by-default behavior, separation of duties, and handling of conflicting rules. We also discuss policy as code, where rules are stored in version control, reviewed and tested like software.
For AI features, the same policies must apply to retrieval, database queries and tool actions, so the system uses one decision point rather than repeating logic in many places.
The labs use a small local policy engine with synthetic roles and resources, plus reproducible tests.
By the end of this lecture you will be able to model roles and attributes, write maintainable authorization policies and test them against realistic scenarios.
Derive tenant context from verified identity. Tenant isolation fails when the system trusts the wrong source for tenant information. This lecture explains how to derive tenant context from verified identity rather than from user input or model output.
We start with the risk. If a request body, query parameter or model-generated argument can specify the tenant, a mistake or manipulation could point a query at another tenant's data. The tenant should be established once, early in the request, from a verified token claim or a trusted directory lookup, and then carried in an immutable request context.
You will learn how to build that context object, which holds the user, tenant, roles and request identifier, and how every downstream component receives it explicitly. We discuss handling users who belong to multiple tenants, where an explicit and validated selection is required, and administrative support scenarios with additional approval and logging.
Context should flow into database sessions, retrieval filters, cache keys, logs and tool calls. Any component that cannot receive it should be treated as a design smell.
The labs use synthetic users and local tests, including cases where a caller attempts to supply a different tenant value.
By the end of this lecture you will be able to implement trustworthy tenant context and explain why it must never come from untrusted input.
Filter retrieval before model context assembly. A retrieval system that fetches documents first and filters later risks placing unauthorized text into a model prompt. This lecture explains why authorization filtering must happen before context assembly and how to implement it.
We start with the failure pattern. If the retriever returns the top matches across all tenants and the application removes disallowed items afterward, results may be unexpectedly empty, ranking may leak information through side effects and, if a bug skips the filter, protected text reaches the model and then the user.
The safer design applies tenant and permission constraints inside the search itself, using metadata filters or separate indexes so that unauthorized documents never become candidates. A second deterministic check just before context assembly confirms each chunk is allowed, providing defense in depth. We discuss how access labels are stored during ingestion and refreshed when permissions change.
We also cover testing. Create documents for two tenants with similar content, query as each and verify that no unauthorized chunk, title or citation appears anywhere in the prompt or response.
The examples use synthetic documents and a local retrieval component.
By the end of this lecture you will be able to implement pre-retrieval authorization filtering, add a second safety check and test for leakage.
Partition caches and conversation state. Caches and stored conversations improve speed and user experience, but they can also create quiet cross-tenant leaks. This lecture explains how to partition them correctly.
We begin with caches. A cache key that omits tenant, user permissions, policy version or document version can return one party's answer to another. You will learn to include the relevant context in the key, set sensible expiry, and avoid caching responses that depend on volatile authorization unless the policy version is part of the key. We also discuss shared caches, the risk of stale entries after revocation and the need to invalidate on permission changes.
Next is conversation state. Chat history, summaries and intermediate tool results must be stored per tenant and user, with retention limits and deletion support. We discuss why summaries can carry sensitive content forward, how to apply the same classification as the source and how to avoid mixing state between sessions.
We cover testing with simulated users that try to read each other's cached or stored data.
The labs use synthetic users and local in-memory stores with reproducible tests.
By the end of this lecture you will be able to design safe cache keys, partition conversation storage and verify that isolation persists across performance optimizations.
Test revocation and cross-tenant access. Authorization is only trustworthy if you can show it works when access is removed and when someone tries to cross a boundary. This lecture focuses on testing revocation and cross-tenant behavior.
We begin with revocation scenarios. A user is removed from a group, a role is downgraded, a token is revoked or a tenant is suspended. The system should stop granting access within a defined time, and that time should be measured. We discuss how long-lived tokens, caches and open sessions can delay enforcement, and how to design checks and invalidation to meet your target.
Next are cross-tenant tests. You will build a matrix of actors, resources and operations, covering reads, searches, writes, tool actions, cached answers and error messages. Each case has an expected outcome, and tests assert that the response neither returns nor hints at data from another tenant.
We also cover reporting. Test results should be saved as evidence that can support audits and release decisions.
The labs use synthetic users, local services and reproducible test cases.
By the end of this lecture you will be able to design revocation tests, build an access matrix and produce clear evidence that isolation and removal of access really work.
Hands-on Lab: Access-control matrix. In this lab you build an access-control matrix for the support copilot and implement tests that prove it holds across retrieval, database access, caches and tool actions. The lab uses synthetic users and documents, runnable Python and reproducible test cases, with no paid AI services.
The steps I would expect you to follow are these. First, define roles, attributes and resources, then express the permitted operations in a matrix. Second, implement a single policy decision function that reads verified identity and returns allow or deny with a reason. Third, derive tenant context from token claims and pass it through the request. Fourth, apply filtering inside a local retriever before any context is assembled. Fifth, partition a cache and conversation store by tenant and policy version. Sixth, write tests for allowed access, denied access, revocation and cross-tenant attempts, then export a results table.
You will also complete a role-play where you present the matrix to an auditor and explain how each cell is enforced and tested.
Keep the matrix and its tests under version control, and rerun them whenever roles, policies or data sources change, so that the evidence always reflects the current system.
By the end of this lab you will have an enforceable policy matrix, a passing isolation test suite and reusable evidence for later release and governance work.
Read API contracts and pagination rules. Enterprise AI systems depend on SaaS and internal APIs, and reading the contract carefully prevents many integration failures. This lecture shows how to interpret API documentation and implement correct pagination.
We begin with what a contract contains: endpoints, methods, authentication requirements, request and response schemas, error formats, rate limits, versioning policy and deprecation notices. You will learn to extract the details that affect your design, such as which fields can be null, which identifiers are stable and which operations are safe to repeat.
Next is pagination. APIs return large collections in pages using offsets, page numbers or cursors, and each style has pitfalls. Offset paging can skip or repeat items when data changes during iteration, while cursor paging is more stable but may expire. We discuss following next links rather than constructing them, handling empty pages, respecting maximum page sizes and storing the last cursor so that a job can resume.
We also cover defensive parsing. Treat unexpected fields and missing values as conditions to handle explicitly, and validate responses against your own schemas.
The labs use a local fake SaaS server with synthetic data and reproducible tests.
By the end of this lecture you will be able to read an API contract critically, write a robust paginated client and detect contract changes through tests.
Request least-privilege integration scopes. Every permission an integration holds is something that can be misused, so the right goal is to request only what the workflow truly needs. This lecture explains how to select and justify least-privilege scopes for SaaS integrations.
We start by mapping actions to permissions. List each operation the copilot must perform, such as reading ticket summaries or adding an internal note, then find the narrowest scope that allows it. Separate read from write, prefer resource-specific scopes over broad administrative ones and avoid permissions that grant more data than the feature uses.
You will learn how to document scope decisions, including the business reason, the data affected and the alternatives considered. We discuss phased requests, where additional scopes are requested only when a feature is enabled, and how to review scopes periodically as APIs and requirements change.
Consent and tenant administration matter too. Customers often approve scopes, so clear explanations help them trust your integration, and revocation must be handled gracefully.
The labs use a local simulated SaaS provider with synthetic scopes and tests that confirm out-of-scope calls fail as expected.
By the end of this lecture you will be able to choose minimal scopes, justify them to reviewers and design integrations that stay safe as they evolve.
Handle quotas, timeouts, and backoff. External APIs limit how fast you can call them and sometimes fail, and your system must behave well in both cases. This lecture explains how to handle quotas, timeouts and backoff responsibly.
We begin with quotas. APIs communicate limits through status codes and headers that indicate remaining capacity and when to retry. Your client should read these signals, share capacity fairly across tenants and avoid creating bursts that trigger throttling. We discuss client-side rate limiters and queues that smooth traffic.
Next are timeouts. Every call needs connection and read timeouts that fit within the request deadline from earlier lessons. Without them, slow dependencies exhaust workers.
Then backoff. Retry only errors that are likely temporary, use exponential delays with random jitter, respect retry instructions from the server and stop after a bounded number of attempts. Never retry operations that are not safe to repeat unless they have idempotency protection, which we cover next.
We also discuss surfacing clear, bounded errors to users when an integration is unavailable.
The labs use a local fake API that simulates throttling, delays and intermittent failures, with deterministic tests.
By the end of this lecture you will be able to build a polite, resilient API client and test its behavior under stress.
Design idempotency and deduplication. Networks fail, requests are retried and events are delivered more than once, so enterprise systems must tolerate repetition. This lecture explains idempotency and deduplication as core techniques for safe integrations.
An operation is idempotent when performing it several times has the same effect as performing it once. Reads are naturally idempotent, while actions such as creating a ticket or sending a message are not. To make them safe, the caller generates a unique idempotency key for each logical operation and the receiver stores the result, returning it when the same key appears again.
You will learn how to generate stable keys from business identifiers or operation identities, how long to keep them, how to handle concurrent duplicates with locks or unique constraints and what to do when the same key arrives with different content, which should be rejected.
Deduplication is the related practice for incoming data, where repeated events or records are detected using identifiers or content hashes and processed once.
These ideas become essential for AI workflows, where retries after a crash must not repeat business actions.
The labs use a local fake service and deterministic tests that replay requests.
By the end of this lecture you will be able to design idempotent operations and deduplicate repeated inputs reliably.
Reconcile partial writes and revoked credentials. Integrations rarely fail cleanly. A multi-step update may complete only partly, or a credential may be revoked halfway through a job. This lecture explains how to detect and repair such situations.
We start with partial writes. When an operation touches several resources, a crash or error can leave some changes applied and others missing. You will learn to record intent before acting, track each step's status and use reconciliation jobs that compare your records with the external system and then complete or compensate as needed. We discuss compensating actions, which undo effects when true rollback is unavailable, and why they should be logged and reviewed.
Next are revoked credentials. A customer may remove consent, a token may expire or an administrator may disable an account. The integration should recognize authorization failures, stop retrying, mark the connection as needing attention, notify the right owner and avoid continuing with stale assumptions.
We also cover reporting, so operators can see which operations are unresolved and why.
The labs use a local fake SaaS service with synthetic data and scripted failures, plus deterministic tests.
By the end of this lecture you will be able to design recovery processes for incomplete work and handle revoked access cleanly and visibly.
Hands-on Lab: Connector contract. In this lab you build a connector for a fake SaaS ticketing service and define the contract that governs how the support copilot uses it. The lab uses a local fake server, synthetic data, runnable Python and reproducible tests, with no paid AI services.
The steps I would expect you to follow are these. First, read the provided API description and list the endpoints, scopes and limits you will use. Second, write a paginated client that follows cursors and validates responses. Third, choose least-privilege scopes and document why each is needed. Fourth, add timeouts, quota handling and exponential backoff with jitter. Fifth, implement idempotency keys for create and update operations and test that repeated calls do not duplicate work. Sixth, add a reconciliation routine that finds partially applied operations and handles a revoked credential by pausing the connector.
The provided tests simulate throttling, duplicates, crashes and revoked access, so you can confirm your behavior matches the expected results. You will also complete a role-play in which you explain connector limitations to a customer administrator.
Keep the connector contract in version control with its tests, so that any change to scopes, retry rules or pagination logic is reviewed before it reaches production use.
By the end of this lab you will have a tested connector contract that you can reuse as a pattern for other integrations.
Design full loads and incremental cursors. Keeping an AI system's knowledge current without reprocessing everything requires a sound ingestion strategy. This lecture explains full loads and incremental cursors and how to combine them.
A full load reads the entire source and replaces or rebuilds derived data. It is simple and good for initial population or periodic repair, but it can be slow and expensive. An incremental load reads only what changed since the last successful run, using a cursor such as a modified timestamp, a sequence number or a change token provided by the source.
You will learn how to choose cursor fields carefully. Timestamps can have gaps, ties and clock skew, so we discuss overlapping windows and stable tie-breakers. We cover storing cursor state transactionally with the data it describes, so a crash does not skip or duplicate changes, and designing runs to be restartable.
We also discuss schedules, backfills, large initial loads and how to record run metadata, including counts, durations and errors, in an ingestion ledger.
The labs use a synthetic source and local pipeline with deterministic tests that replay runs.
By the end of this lecture you will be able to design reliable full and incremental ingestion and explain the tradeoffs of each approach.
Process webhooks with authenticity checks. Webhooks let a source system notify you immediately when something changes, but they arrive from the open internet, so each one must be verified. This lecture explains how to receive webhooks safely.
We begin with authenticity. Most providers sign each delivery with a shared secret or key, and your handler must verify the signature over the raw request body, check the timestamp to reject old deliveries and compare values using constant-time methods. Requests that fail verification are rejected without processing and logged without including sensitive content.
Next is handler design. Respond quickly after durably recording the event, then process it asynchronously, since slow handlers cause provider retries. Validate the payload against a schema, confirm the tenant mapping from trusted configuration and never trust identifiers inside the payload without checking them against your records.
We also cover replay protection through event identifiers, secret rotation and monitoring for unusual delivery patterns.
Webhooks should be treated as hints that something changed, with the authoritative state fetched or reconciled from the source when accuracy matters.
The labs use a local simulated sender, synthetic secrets and deterministic tests, including tampered and expired deliveries.
By the end of this lecture you will be able to implement a verified, resilient webhook receiver.
Handle duplicate and out-of-order events. Event streams from enterprise systems are rarely perfect, and your ingestion must produce the right state anyway. This lecture explains how to handle duplicate and out-of-order events.
Duplicates occur because providers retry deliveries and because your own jobs may rerun. Out-of-order delivery occurs because network paths and queues do not guarantee sequence, so an update may arrive before the creation it depends on, or an old version may arrive after a newer one.
You will learn defensive techniques. Use event identifiers to discard repeats. Compare version numbers or source timestamps and apply an event only if it is newer than the stored state. When a dependency is missing, park the event for a limited time and retry, or fetch the current state directly from the source. Prefer idempotent upserts over blind inserts.
We also discuss designing events as state snapshots rather than deltas where possible, which simplifies recovery, and storing enough history to explain why a record has its current value.
The labs use a synthetic event generator that shuffles and repeats events, with deterministic tests that assert the final state is correct regardless of order.
By the end of this lecture you will be able to build ingestion logic that converges to the right state despite imperfect event delivery.
Propagate deletions and access changes. When a document is removed or a person's access changes at the source, the AI system must follow quickly. This lecture explains how to propagate deletions and permission changes through ingestion.
We begin with deletions. Sources may delete records, mark them as inactive or simply stop returning them. Your pipeline must detect each pattern and remove the document, its chunks, embeddings, caches and any citations that depend on it. We discuss tombstones that record the deletion, retention exceptions for legal holds and verification that nothing remains in derived stores.
Next are access changes. Permissions may be updated through group membership, sharing settings or document labels. If your index stores copies of access information, it must be refreshed when those change, otherwise a user could continue to retrieve content they should no longer see. We discuss event-driven updates, periodic permission synchronization and the maximum staleness you are willing to accept.
We also address monitoring: measure the delay between a change at the source and its effect in the system, and alert when it exceeds the target.
The labs use synthetic documents with scripted deletions and permission changes, plus deterministic tests.
By the end of this lecture you will be able to design propagation that keeps the AI system aligned with source decisions.
Reconcile source state after missed events. Even well-built pipelines miss events through outages, bugs or provider limits, so you need a way to detect and repair drift. This lecture explains reconciliation of source state.
We start by accepting that events are hints, not guarantees. A reconciliation process periodically compares what the source says exists with what your system holds, using lightweight listings, counts, versions or hashes. Differences fall into categories: missing records to add, stale records to update, orphaned records to remove and permission differences to refresh.
You will learn how to design reconciliation efficiently. Compare compact summaries first, such as per-partition checksums, and only fetch details where they differ. Run it on a schedule and after known incidents, limit its load on the source and make it safe to rerun.
We also discuss reporting the results, including how much drift was found and why, since recurring drift points to a defect worth fixing.
Reconciliation also supports audits, because it provides evidence that the index reflects the source within a stated tolerance.
The labs use a synthetic source with intentionally missed events and deterministic tests.
By the end of this lecture you will be able to implement reconciliation, interpret its results and use it as a safety net for ingestion.
Hands-on Lab: Ingestion ledger. In this lab you build an incremental ingestion pipeline with a ledger that records every run, event and decision for the support copilot. The lab uses synthetic sources, runnable Python and reproducible tests, with no paid AI services.
The steps I would expect you to follow are these. First, implement a full load and an incremental load that uses a stored cursor with an overlap window. Second, add a webhook receiver that verifies signatures and timestamps, records the event and queues it for processing. Third, write processing logic that discards duplicates, rejects stale versions and parks events whose dependencies are missing. Fourth, handle deletions and permission changes by removing or updating derived records. Fifth, record each run and decision in a ledger table with counts, cursor values and errors. Sixth, create a reconciliation job that compares the source with the index and repairs drift.
The provided tests shuffle, repeat and drop events, then check that the final state matches the source. You will also complete a role-play explaining the ledger to an operations lead who needs to troubleshoot a missing document.
Review the ledger output after every test run, because patterns in counts, parked events and repaired records often reveal design weaknesses before they become operational incidents.
By the end of this lab you will have a restartable, auditable ingestion pipeline.
Choose chunk boundaries and metadata. Retrieval quality begins long before search, at the point where documents are divided into chunks and labeled. This lecture explains how to choose chunk boundaries and metadata that make retrieval accurate and safe.
We start with chunking. Chunks that are too small lose context and produce fragments that cannot support an answer, while chunks that are too large dilute relevance and waste prompt space. You will learn to respect document structure, such as headings, sections, tables and lists, to include modest overlap where meaning crosses boundaries and to keep each chunk linked to its parent document and position.
Next is metadata. Useful fields include document identifier, version, title, section path, source system, tenant, access labels, language, effective dates and content type. Metadata supports filtering, citation, freshness checks and debugging. We emphasize that authorization-related metadata must be accurate and refreshed, since retrieval filters depend on it.
We also discuss how to evaluate chunking choices with labeled test questions rather than intuition, and how to record the chunking configuration so results are reproducible.
The labs use synthetic documents and a local retrieval component with deterministic tests.
By the end of this lecture you will be able to design chunking and metadata schemes and justify them with evidence.
Compare lexical and semantic retrieval. Search methods differ in what they find well, and enterprise systems often need both. This lecture compares lexical and semantic retrieval and explains when to combine them.
Lexical retrieval matches the words in a query with the words in documents, using techniques such as term weighting and ranking functions. It is precise for identifiers, product names, error codes and exact phrases, and it is easy to explain. Semantic retrieval compares vector representations of meaning, so it can find relevant passages that use different wording, such as a paraphrase or a related concept. It can miss exact identifiers and is harder to explain.
You will learn the strengths and weaknesses of each, how hybrid approaches merge ranked lists, and how to tune weights using labeled queries. We discuss how filters apply to both, how to handle multilingual content and how embedding model changes require reindexing and re-evaluation.
The key habit is measurement. Rather than assuming one method is better, compare them on representative questions and examine failures.
The labs use a small synthetic corpus and a local deterministic embedding stand-in, so no paid services are needed.
By the end of this lecture you will be able to compare retrieval approaches and choose or combine them based on evidence.
Apply metadata and authorization filters. Retrieval must respect who is asking and what the question is about. This lecture explains how to apply metadata and authorization filters during search in a way that is correct and efficient.
We begin with the distinction. Metadata filters narrow results by attributes such as document type, product, date range or language, which improves relevance. Authorization filters restrict results to what the verified user may see, which is a security requirement. Both are applied before ranking, but only the second is mandatory for safety, and it must never be left to the model or the user's query.
You will learn how to express filters as structured conditions built from the request context, how to combine them with search queries and how to handle large permission sets using group-based labels instead of enumerating documents. We discuss the tradeoffs of filtering before versus during approximate search, and why some index types need care to avoid returning too few results.
We also cover testing: confirm that filters return the right items, that empty results are handled gracefully and that no information about excluded documents leaks through counts or error messages.
The labs use synthetic documents and local tests.
By the end of this lecture you will be able to implement and verify combined metadata and authorization filtering.
Rerank within the authorized candidate set. A first-pass search returns plausible candidates, and a reranker orders them more carefully. This lecture explains how to rerank safely, within the set of documents the user is authorized to see.
We start with the purpose of reranking. Initial retrieval is fast but coarse. A reranker examines the query together with each candidate and produces a better relevance score, improving which passages reach the prompt. This is helpful when the context budget is small.
The safety rule is simple: the reranker only ever receives candidates that have already passed authorization filtering. Sending unauthorized text to any component, including a reranking model, can expose information and violates the boundary you built earlier.
You will learn how to choose the candidate count, balance cost and latency, combine reranker scores with metadata signals such as recency or authority and set a cutoff below which results are discarded. We also discuss diversity, to avoid filling the context with near-duplicate passages, and logging scores for debugging.
The labs use a local deterministic reranker stand-in with synthetic documents, so you can test ordering and safety without paid services.
By the end of this lecture you will be able to design a reranking stage that improves relevance while preserving authorization guarantees.
Measure retrieval recall on labeled cases. You cannot improve retrieval without measuring it. This lecture explains how to build labeled cases and measure recall so that changes to chunking, search or reranking can be compared objectively.
We begin with the dataset. Each case contains a realistic question, the tenant and user context in which it is asked and the passages or documents that should be retrieved, labeled by a person who understands the domain. Include easy cases, hard cases, paraphrased questions and cases where the correct answer is that no relevant evidence exists.
Next are the metrics. Recall at k measures how often the right evidence appears in the top results, and reciprocal rank and similar measures reflect how high it appears. We explain why recall matters for retrieval, since missing evidence cannot be recovered later, while precision and context size affect cost and noise.
You will learn to slice results by question type, source and tenant to find weak spots, keep a held-out set to avoid overfitting and store results with configuration identifiers for reproducibility.
The labs use synthetic labeled cases and deterministic scoring scripts.
By the end of this lecture you will be able to create labeled retrieval datasets, compute recall metrics and use them to guide decisions.
Hands-on Lab: Retrieval evaluation. In this lab you build and evaluate a retrieval component for the support copilot, comparing lexical, semantic and hybrid approaches under authorization filters. The lab uses a synthetic corpus, runnable Python and reproducible tests, with no paid AI services.
The steps I would expect you to follow are these. First, chunk the provided documents with two different strategies and attach metadata including tenant, version and access labels. Second, implement lexical search and a deterministic semantic stand-in and combine them in a hybrid ranker. Third, apply metadata and authorization filters before ranking. Fourth, add a simple reranking stage that only sees authorized candidates. Fifth, run the labeled cases and compute recall at several cutoffs, sliced by question type. Sixth, examine the failures and write a short analysis of what to change next.
Tests confirm that no unauthorized chunk ever appears in candidates or reranker inputs. You will also complete a role-play in which you explain the evaluation results and your recommended configuration to a product owner.
Save the dataset, configuration identifiers and metric outputs together, so that a later reviewer can reproduce your numbers and compare them fairly against any improved retrieval configuration.
By the end of this lab you will have a measured retrieval baseline, a comparison of methods and a repeatable evaluation workflow.
Assemble context with source identifiers. The text you place in a model prompt determines what the model can say, so context assembly deserves engineering discipline. This lecture explains how to build context from retrieved passages while keeping every piece traceable to its source.
We begin with the goals. The context should contain the most relevant authorized evidence within the token budget, be organized clearly and let both the model and later reviewers know where each statement came from. You will learn to label each passage with a stable source identifier, document title, version and section, and to separate passages with consistent delimiters.
Next we cover budgeting. Decide how many passages to include, trim by relevance and remove near-duplicates. Keep the instructions, the user's question and the evidence in clearly separated parts of the prompt. Record exactly what was included in each request so that answers can be audited and reproduced later.
We also discuss ordering, the cost of long contexts and why more text is not always better, since irrelevant passages can distract from the evidence that matters.
The labs use synthetic documents and a deterministic local model adapter.
By the end of this lecture you will be able to assemble context with traceable identifiers, manage token budgets and record what the model actually saw.
Distinguish evidence from untrusted instructions. Retrieved documents are data, not commands, and a robust system must never confuse the two. This lecture explains how to separate evidence from untrusted instructions in grounded answering.
The concern is that documents, web pages, emails and tickets may contain text that looks like an instruction, such as a line telling the assistant to ignore its rules or reveal something. If the system treats all text in the prompt as equally authoritative, such content can influence behavior. This is often called indirect prompt injection, and it is a design problem as well as a model problem.
You will learn defensive practices at a conceptual level. Clearly mark retrieved text as quoted evidence. State in the system instructions that evidence may contain instructions that must not be followed. Keep privileged instructions separate from user and document content. Restrict what the model can do with tools, so that even a confused response cannot cause harm. Validate outputs and require approval for sensitive actions.
The labs use harmless synthetic marker phrases in documents to confirm that the system treats them as evidence only.
By the end of this lecture you will be able to structure prompts and controls so that retrieved content informs answers without taking control of behavior.
Bind citations to retrieved document versions. A citation is only useful if it points to exactly what supported the answer. This lecture explains how to bind citations to specific document versions and verify them.
We start with the failure modes. A citation may name a document that changed after the answer was written, refer to a passage that was never retrieved or be invented by the model. Any of these weakens trust and creates audit problems.
The solution is to treat citations as structured data. Each retrieved passage has an identifier that includes the document, version and location. The model is asked to cite these identifiers rather than free-form titles, and deterministic code then verifies that every cited identifier was actually in the context. The final response presents human-friendly references while storing the exact identifiers.
We also discuss what happens when a document is updated or deleted, including marking older answers as based on superseded evidence and removing citations to deleted sources.
Verification can also check that the cited passage plausibly supports the claim, using rules or evaluation methods covered later.
The labs use synthetic documents with versions and tests that detect fabricated citations.
By the end of this lecture you will be able to implement version-bound citations and validate them automatically.
Abstain when evidence is missing or conflicting. A trustworthy assistant knows when not to answer. This lecture explains how to design abstention behavior for cases where evidence is missing, weak or contradictory.
We begin with why abstention matters. Models tend to produce fluent answers even when the context does not support them, and in enterprise settings a confident but unsupported answer can mislead customers or trigger wrong actions. A good system prefers a helpful refusal, a clarifying question or an escalation to a human.
You will learn how to detect the conditions. Missing evidence can be signaled by empty or low-scoring retrieval results. Conflicting evidence appears when authoritative passages disagree, such as two versions of a policy. Insufficient authorization means the answer might exist but the user cannot see it, and the response must not hint at protected content.
We design response patterns that explain what is known, what is missing and what the user can do next, such as rephrasing or contacting a specialist. We also cover how to combine thresholds, rules and model judgments, and how to measure abstention quality.
The labs use synthetic cases covering all three conditions.
By the end of this lecture you will be able to implement and test principled abstention.
Evaluate unsupported claims and citation coverage. Grounded answering must be measured, not assumed. This lecture explains how to evaluate whether answers contain unsupported claims and whether citations cover the statements that need them.
We start by breaking an answer into individual claims. Each claim should either be supported by cited evidence, be common knowledge that needs no citation or be flagged as unsupported. Citation coverage is the share of claims that need evidence and have valid supporting citations, while the unsupported-claim rate is the share that lack it.
You will learn evaluation methods. Human reviewers can label claims against the provided context using a clear rubric. Automated checks can verify that cited identifiers exist and appear in the context, and model-based judges can estimate support, provided they are calibrated against human labels, which we cover later in the course.
We also discuss building cases that test abstention, conflicting sources and distracting passages, and tracking results across versions so regressions are visible.
The labs use synthetic answers with known supported and unsupported claims, plus deterministic scoring scripts.
Keep the labeled claims and scoring scripts with your evaluation data, so that grounding quality can be compared fairly each time the prompts, retrieval or models change.
By the end of this lecture you will be able to define grounding metrics, apply them to sample outputs and interpret the results.
Hands-on Lab: Grounding contract. In this lab you implement a grounded answering contract for the support copilot that assembles traceable context, treats retrieved text as evidence, binds citations to versions and abstains when appropriate. The lab uses synthetic documents, a deterministic local model adapter, runnable Python and reproducible tests, with no paid AI services.
The steps I would expect you to follow are these. First, assemble context from authorized passages with source identifiers and a token budget. Second, write prompt instructions that mark evidence as untrusted and test them with harmless marker phrases inside documents. Third, define a structured answer format with claims and citation identifiers. Fourth, add a verifier that rejects citations not present in the context or tied to superseded versions. Fifth, implement abstention rules for missing, conflicting and unauthorized evidence. Sixth, run the provided cases and compute citation coverage and unsupported-claim rates.
You will also complete a role-play explaining to a support manager why the assistant sometimes declines to answer and how that protects customers.
Keep the contract, the prompts and the test cases together in version control, and rerun them whenever retrieval settings or instructions change, so that grounding quality stays measurable and regressions are caught early.
By the end of this lab you will have a tested grounding contract and a measurable baseline for answer quality.
This course contains the use of artificial intelligence.
The Enterprise AI Engineer Bootcamp teaches you how to design, build, and evaluate AI systems that work with enterprise data, authentication, databases, APIs, and SaaS applications.
You’ll move through the engineering decisions behind an enterprise support copilot, from selecting a useful business workflow to preparing release evidence and operational runbooks. The focus is on observable behavior: what the system can access, which actions it can perform, how it handles failures, and how you verify its results.
You’ll begin by mapping enterprise systems and trust boundaries, separating deterministic business rules from model decisions, and defining measurable quality, latency, and cost targets. You’ll then explore Python service contracts, data validation, tenant-scoped database queries, authentication, authorization, and integration patterns.
As you progress, you’ll learn how to keep retrieved evidence aligned with source changes, evaluate retrieval quality, bind citations to document versions, and abstain when evidence is missing or conflicting. You’ll also practise validating model-generated tool proposals, enforcing approval requirements, and recovering from interrupted workflows without repeating business actions.
The course covers the controls needed to prepare AI systems for enterprise operation, including regression testing, privacy-conscious observability, security testing, governance records, reliability budgets, deployment gates, rollback planning, and incident response.
Your learning resources include:
20 hands-on labs with runnable Python examples and reproducible test cases.
20 role-play activities to practise explaining engineering decisions to stakeholders.
100 section quiz questions with answer explanations.
Two practice tests containing 60 questions.
A capstone integration assignment with an assessment rubric.
The labs use synthetic data and deterministic local adapters, allowing you to practise without paid AI services. They clearly distinguish local demonstrations from the additional integration work required for production systems.
This course is intended for backend developers, data engineers, and applied AI developers who already understand basic Python, SQL, and HTTP APIs. By completing it, you’ll be able to demonstrate enterprise AI boundaries, evaluate failure behavior, and assemble evidence to support deployment and operating decisions.