> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/academy/tier-2-core-skills/m03-agent-builder-fundamentals/lab-3-configure-knowledge-triggers-secrets-and-authentication.md). Agents can also search and read this documentation through its [MCP server](https://docs.uptiq.ai/~gitbook/mcp).

# Lab 3: Configure knowledge, triggers, secrets and authentication

Hands-on lab for lesson 3 of module M03, configure knowledge, triggers, secrets and authentication.

{% @uptiq-training/training-labels content="Module 3 | brand
Lesson 3 of 8 | brand
Lab 3 | success
12 minutes | neutral
Bloom level Apply | neutral" %}

{% @uptiq-training/training-navigator title="M03 Agent Builder Fundamentals — Executor 1.4" content="Lesson 1: Configure agent identity and instructions | soon
Lab 1: Configure agent identity and instructions
Lesson 2: Configure agent behavior, runtime and skills | soon
Lab 2: Configure agent behavior, runtime and skills
Lesson 3: Configure knowledge, triggers, secrets and authentication | soon
Lab 3: Configure knowledge, triggers, secrets and authentication | current
Lesson 4: Guardrails for a financial workflow | soon
Lab 4: Guardrails for a financial workflow
Lesson 5: Knowledge check 1 | soon
Lesson 6: Test, validate and troubleshoot the agent | soon
Lab 6: Test, validate and troubleshoot the agent
Lesson 7: Export the agent bundle and configure access controls | soon
Lab 7: Export the agent bundle and configure access controls
Lesson 8: Apply financial skills to a configured agent | soon
Lab 8: Apply financial skills to a configured agent" %}

## Lab overview

**Exercise title:** Configure Knowledge, Triggers, Secrets, and Authentication

**Difficulty level:** Apply (Bloom Level 3 — you will perform configuration tasks in the platform, not just recall or recognize concepts)

**Estimated hands-on time:** 12 minutes (of an 18-minute lesson; the first 4 minutes are a concept video)

**What you will build:** A borrower onboarding agent in the Uptiq Platform Agent Builder with four configuration screens completed:

* **Knowledge Attachment** — a pre-built borrower onboarding knowledge base attached to the agent
* **Triggers** — a chat trigger configured so the agent fires when a borrower sends a message
* **Secrets & Variables** — the Secrets table reviewed and, if required, API credentials added as a secured secret
* **Authentication** — Microsoft Entra ID caller authentication enabled with your tenant and client IDs saved

**Prerequisites:** Before starting this lab, you must have completed the configuration steps from Lessons 1 and 2 of this module — specifically, your borrower onboarding agent must already exist in Agent Builder with Basic Details, Instructions, Agent Behavior, Runtime (executor 1.4), and Skills & Capabilities configured. A pre-built borrower onboarding knowledge base must already exist in your project's Knowledge section. If either of these is missing, complete the earlier lessons before proceeding.

## Your sandbox environment

**Environment access URL:** `<provided by your instructor>`

**Connection details you will need during this lab:**

| **Field**                                        | **Where to find it**                                                                                      |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| **Microsoft Entra ID — Directory (tenant) ID**   | Your exercise materials packet, or the Overview page of your registered app in the Azure portal           |
| **Microsoft Entra ID — Application (client) ID** | Your exercise materials packet, or the Overview page of your registered app in the Azure portal           |
| **KYC/KYB skill API credentials (if required)**  | Your exercise materials packet — see Content Gap note in Step 5                                           |
| **Your sandbox email address**                   | The email account you used to log in to the Platform — you will receive the export email here in Lesson 4 |

**Pre-provisioned resources — you do not need to set these up:**

* **Borrower onboarding knowledge base** — already built and synced in your project's Knowledge section. You will attach it in Procedure 1 but you do not need to create or sync it.
* **Microsoft Entra ID app registration** — already registered for this exercise. The tenant ID and client ID are in your exercise materials.
* **Agent skeleton** — your borrower onboarding agent already exists from Lessons 1 and 2 with executor 1.4 selected.

## Configuration template

This lab does not use a file-based configuration template. All configuration is performed through the Agent Builder UI. The values you will enter are listed below for reference before you begin.

Knowledge Attachment — no fields to fill in. You will select a pre-existing knowledge base by name. No values to enter.

**Trigger configuration:**

| **Field**          | **Value to enter**                                                 |
| ------------------ | ------------------------------------------------------------------ |
| **Trigger Source** | `Chat`                                                             |
| **Trigger Name**   | `Borrower Chat`                                                    |
| **Description**    | `Fires when a borrower sends a message through the chat interface` |

**Secrets & Variables — if API credentials are required for the KYC/KYB skill:**

| **Field**          | **Value to enter**                                |
| ------------------ | ------------------------------------------------- |
| **Secret Name**    | `<name from your exercise materials>`             |
| **Secret Type**    | `Text`                                            |
| **Secret Value**   | `<API key or token from your exercise materials>` |
| **Secured toggle** | On                                                |

{% hint style="warning" %}
Do not paste API keys or tokens directly into the Instructions screen or into a skill's configuration fields. Always store sensitive values as secrets and reference them as `$secret.{name}`. Inline credentials are exposed in plaintext and create a security risk.
{% endhint %}

**Authentication configuration:**

| **Field**                   | **Value to enter**               |
| --------------------------- | -------------------------------- |
| **Enable Authentication**   | On                               |
| **Authentication Provider** | `Microsoft Entra ID`             |
| **Directory (tenant) ID**   | `<from your exercise materials>` |
| **Application (client) ID** | `<from your exercise materials>` |

## Step-by-step instructions

### Procedure 1 — Attach the Knowledge Base

{% stepper %}
{% step %}
**Open the Knowledge card on the Builder Canvas**

On the Builder Canvas, locate the Knowledge card. It currently reads "No knowledge added yet."

Select + Add Knowledge.
{% endstep %}

{% step %}
**Select Use Existing Knowledge**

The Add Knowledge dialog opens. Select Use Existing Knowledge.

The dialog switches to the Knowledge tab and displays the knowledge bases available in your project.
{% endstep %}

{% step %}
**Find and select the borrower onboarding knowledge base**

In the knowledge base list, locate the borrower onboarding knowledge base by name. If the list is long, use the Search knowledge field to filter by name.

Tick the checkbox next to the borrower onboarding knowledge base.

{% hint style="info" %}
You can attach more than one knowledge base to a single agent. For this exercise, attach only the borrower onboarding knowledge base.
{% endhint %}
{% endstep %}

{% step %}
**Add the knowledge base**

Select Add.

The dialog closes. The Knowledge card on the Builder Canvas now shows the attached knowledge base with its name and a count of one.

{% hint style="success" %}
**Checkpoint:** Confirm the Knowledge card on the canvas shows the borrower onboarding knowledge base by name. If the card still reads "No knowledge added yet," the attachment did not save — repeat Steps 1–4.
{% endhint %}

{% hint style="info" %}
**Concept:** The knowledge base you just attached was built and synced before this lab. Agents answer from the latest completed sync version only. If the knowledge base is updated after you attach it, the agent will not see those changes until the knowledge base is synced again and a new version is created.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 2 — Configure the Chat Trigger

{% stepper %}
{% step %}
**Open the Triggers screen**

Alternatively, open Agent Config (the Agent Config button in the canvas header) and select Triggers in the left navigation.

If no triggers have been created yet, the screen shows "No triggers created" and an Add New Trigger button.
{% endstep %}

{% step %}
**Open the trigger type selector**

Select + Add Triggers or Add New Trigger.

A panel opens showing the available trigger source types.
{% endstep %}

{% step %}
**Set the Trigger Source to Chat**

In the Trigger Source dropdown, select Chat.

A chat trigger fires when a user sends a message to the agent through the chat interface. This is the trigger type that makes the borrower onboarding agent respond to incoming borrower messages.

{% hint style="info" %}
**Concept:** Agent triggers are not the same as flow triggers. This trigger starts your agent. If you also use Flows in your project, those flows have their own separate triggers configured in the flow builder.
{% endhint %}
{% endstep %}

{% step %}
**Enter the Trigger Name**

In the Trigger Name field, enter:

`Borrower Chat`
{% endstep %}

{% step %}
**Enter the Description**

In the Description field, enter:

`Fires when a borrower sends a message through the chat interface`

{% hint style="info" %}
The description is interpreted by a runtime model, not parsed as a rules expression. Write it in plain prose that clearly describes the condition — the platform uses this text to understand when to fire the trigger.
{% endhint %}
{% endstep %}

{% step %}
**Save the trigger**

Select Save.

The Triggers screen now lists the Borrower Chat trigger with its source and description. The Triggers card on the Builder Canvas updates to show a count of one trigger.

{% hint style="success" %}
**Checkpoint:** Confirm the Triggers card on the canvas shows one trigger. Select the Triggers card or open Agent Config → Triggers to verify the Borrower Chat trigger appears with Trigger Source set to Chat.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 3 — Review Secrets & Variables

{% stepper %}
{% step %}
**Open the Secrets & Variables screen**

Open Agent Config and select Secrets & Variables in the left navigation.

The screen shows two tables: Secrets and Variables.
{% endstep %}

{% step %}
**Review the tables**

Review both tables:

* **Secrets** — stores API keys, tokens, and credentials. When the **Secured** toggle is on, the value is encrypted. Reference secrets elsewhere in the builder as `$secret.{name}`.
* **Variables** — stores general-purpose values like base URLs or default parameters. Stored in clear (not encrypted). Reference variables as `$agent.{name}`.

{% hint style="success" %}
**Best practice:** Never paste API keys or tokens directly into the Instructions screen or into skill configuration fields. Always store sensitive values in the Secrets table with Secured turned on, then reference them by name.
{% endhint %}
{% endstep %}

{% step %}
**Add a secret for KYC/KYB API credentials (if required)**

{% hint style="warning" %}
Whether the KYC/KYB skill requires API credentials depends on how the skill is configured in your sandbox. Check your exercise materials. If no credentials are listed, skip this step and move to Procedure 4.
{% endhint %}

If your exercise materials specify API credentials for the KYC/KYB skill:

1. In the **Secrets** table, select **+ Add Secret** (or the equivalent add button in the table).
2. Enter the **Secret Name** from your exercise materials.
3. Set **Type** to `Text`.
4. Enter the **Secret Value** (the API key or token from your exercise materials).
5. Turn on the **Secured** toggle.
6. Select **Save**.

You should see the new secret appear in the Secrets table. The value is masked — you will not be able to read it back after saving.

{% hint style="success" %}
**Checkpoint:** If you added a secret, confirm it appears in the Secrets table with the Secured toggle on and the value masked. If the value is visible in plaintext, the Secured toggle was not on when you saved — delete the entry and re-add it with Secured turned on.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 4 — Configure Authentication

{% stepper %}
{% step %}
**Open the Authentication screen**

Open Agent Config and select Authentication under the Credentials & access section in the left navigation.

The Authentication screen shows the Enable Authentication toggle, currently off.

{% hint style="info" %}
**Concept:** Authentication (this screen) and Access & Security are two different controls. Authentication identifies the person calling the agent — it verifies a Microsoft Entra ID or Google token before the agent runs. Access & Security authorizes the calling application through widget keys and API keys. You need both for a fully secured deployment, but they control different things.
{% endhint %}
{% endstep %}

{% step %}
**Enable Authentication**

Turn on the Enable Authentication toggle.

The Authentication Provider dropdown and provider-specific fields appear below the toggle.
{% endstep %}

{% step %}
**Choose Microsoft Entra ID as the provider**

In the Authentication Provider dropdown, select Microsoft Entra ID.

Two fields appear: Directory (tenant) ID and Application (client) ID.
{% endstep %}

{% step %}
**Enter the Directory (tenant) ID**

In the Directory (tenant) ID field, enter the tenant ID from your exercise materials.

This value comes from the Overview page of your registered application in the Azure portal.
{% endstep %}

{% step %}
**Enter the Application (client) ID**

In the Application (client) ID field, enter the client ID from your exercise materials.

This value also comes from the Overview page of your registered application in the Azure portal.

{% hint style="warning" %}
Enter both IDs exactly as they appear in your exercise materials. A single character error means the platform cannot verify caller tokens, and all authenticated requests will fail.
{% endhint %}
{% endstep %}

{% step %}
**Save the Authentication configuration**

Select Save.

The Authentication screen refreshes and shows Enable Authentication on, with the provider and both IDs saved.

{% hint style="success" %}
**Checkpoint:** Confirm the Authentication screen shows:

* Enable Authentication: On
* Authentication Provider: Microsoft Entra ID
* Directory (tenant) ID: the value you entered (partially masked is normal)
* Application (client) ID: the value you entered (partially masked is normal)

If the Save button is still active after selecting it, a required field may be empty — check both ID fields and save again.
{% endhint %}

{% hint style="info" %}
**Concept:** With Authentication configured this way, the platform behaves as follows: requests with no token still run, but the caller's identity is not available to MCP connections. Requests with an invalid token are rejected. Requests with a valid Microsoft Entra ID token run with the caller's identity available to downstream MCP connections as `$auth.token`.
{% endhint %}
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Fixes for common problems in this lab</summary>

| **Symptom**                                                                          | **Cause**                                                                                                                                                 | **Fix**                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Knowledge card still shows "No knowledge added yet" after completing Procedure 1** | The Add step was not completed, or the dialog was closed before selecting Add                                                                             | Repeat Procedure 1. Make sure you tick the knowledge base checkbox before selecting Add.                                                                                                                                |
| **Agent does not use the attached knowledge base during testing**                    | Knowledge retrieval skill is not enabled, instructions do not guide the agent to consult knowledge, or the knowledge base was not synced before attaching | Check that Knowledge Search is active in Skills & Capabilities. Verify your instructions explicitly tell the agent to consult knowledge sources. Confirm the knowledge base has a completed sync version.               |
| **Knowledge base content appears outdated**                                          | The source files were updated after the last sync                                                                                                         | The knowledge base must be synced again to create a new version. Each sync creates a new version; agents use the latest completed version only. Contact your instructor if you cannot sync the knowledge base yourself. |
| **Triggers card shows zero triggers after saving**                                   | The trigger was not saved, or the save failed silently                                                                                                    | Open Agent Config → Triggers and check whether the Borrower Chat trigger appears. If not, repeat Procedure 2 and confirm you select Save at the end.                                                                    |
| **Authentication Save button remains active after selecting it**                     | A required field (Directory tenant ID or Application client ID) is empty or contains only whitespace                                                      | Check both ID fields. Both are required. Re-enter the values and select Save again.                                                                                                                                     |
| **Authenticated requests are rejected at runtime**                                   | The tenant ID or client ID was entered incorrectly                                                                                                        | Open Agent Config → Authentication, verify both IDs against your exercise materials, correct any errors, and save.                                                                                                      |
| **Secret value is visible in plaintext in the Secrets table**                        | The Secured toggle was off when the secret was saved                                                                                                      | Delete the secret entry and re-add it with the Secured toggle turned on before saving.                                                                                                                                  |
| **Export email does not arrive (relevant to Lesson 4)**                              | Email may be in spam, or the export failed                                                                                                                | Check your spam folder. If a failure email arrived instead, it will include the reason and a View Agent button. Re-export the agent to try again.                                                                       |

</details>

## Checkpoints and validation

**Embedded checkpoints (formative):**

The following confirmations verify that each procedure completed successfully. Work through them in order before moving to the next lesson.

### After Procedure 1 — Knowledge Attachment

Confirm on the Builder Canvas Overview tab that the Knowledge card shows the borrower onboarding knowledge base by name with a count of one. If the card is empty, the attachment did not save — repeat Procedure 1.

### After Procedure 2 — Triggers

Open Agent Config → Triggers. Confirm the Borrower Chat trigger appears with:

* Trigger Source: Chat
* Trigger Name: Borrower Chat
* Description: Fires when a borrower sends a message through the chat interface

If the trigger is missing, repeat Procedure 2.

### After Procedure 3 — Secrets & Variables

If you added a KYC/KYB secret: confirm the secret appears in the Secrets table with the Secured toggle on and the value masked. If you did not add a secret (no credentials were required), confirm the Secrets table is present and the screen loaded without errors.

### After Procedure 4 — Authentication

Confirm the Authentication screen shows Enable Authentication on, Authentication Provider set to Microsoft Entra ID, and both the Directory (tenant) ID and Application (client) ID fields populated. If any field is missing or the toggle is off, repeat Procedure 4.

### Final configuration check — Overview tab

Return to the Builder Canvas Overview tab. Confirm:

* **Triggers card:** shows 1 trigger (Borrower Chat)
* **Knowledge card:** shows the borrower onboarding knowledge base
* **Skills card:** shows Knowledge Search as active (required for the agent to query the knowledge base)
* **Integrations card:** shows any connected services from earlier lessons (or is empty if none were configured)

An empty Triggers or Knowledge card at this point means a configuration step did not save. Return to the relevant procedure and repeat it.

**Assessment Component:** None. Formative assessment for this lesson's content appears in Lesson 5 (Knowledge Check 1).

## Solution reference

<details>

<summary>The completed state of your work</summary>

The following shows the complete, correct state of your agent after all four procedures are successfully completed.

### Knowledge Attachment — completed state

The Knowledge card on the Builder Canvas shows one attached knowledge base: the borrower onboarding knowledge base. The card displays the knowledge base name and a count of 1. The knowledge base has at least one completed sync version (pre-provisioned in your sandbox).

### Trigger — completed state

Agent Config → Triggers shows one trigger with the following values:

| **Field**          | **Value**                                                        |
| ------------------ | ---------------------------------------------------------------- |
| **Trigger Source** | Chat                                                             |
| **Trigger Name**   | Borrower Chat                                                    |
| **Description**    | Fires when a borrower sends a message through the chat interface |

### Secrets & Variables — completed state (if credentials were required)

The Secrets table contains one entry:

| **Field**       | **Value**                                                        |
| --------------- | ---------------------------------------------------------------- |
| **Secret Name** | As specified in your exercise materials                          |
| **Type**        | Text                                                             |
| **Secured**     | On                                                               |
| **Value**       | Masked (the actual API key or token is not visible after saving) |

The secret is referenced in the KYC/KYB skill configuration as `$secret.{name}` — not pasted inline.

If no credentials were required for your sandbox configuration, the Secrets table is empty and the Variables table is empty. This is the correct state.

### Authentication — completed state

Agent Config → Authentication shows:

| **Field**                   | **Value**                                  |
| --------------------------- | ------------------------------------------ |
| **Enable Authentication**   | On                                         |
| **Authentication Provider** | Microsoft Entra ID                         |
| **Directory (tenant) ID**   | The tenant ID from your exercise materials |
| **Application (client) ID** | The client ID from your exercise materials |

### Runtime behavior with this configuration

* A request with no token: runs normally; `$auth.token` is unavailable to MCP connections.
* A request with an invalid Microsoft Entra ID token: rejected before the agent runs.
* A request with a valid Microsoft Entra ID token: runs with the caller's identity available to MCP connections as `$auth.token`.

**Sources used in this lab guide:** Source 9-4, Source 9-7, Source 9-8, Source 9-10, Source 9-19, Source 9-3 (Glossary — Trigger, Trigger Source, Secret, Knowledge base, Authentication (agent)).

</details>

{% hint style="success" %}
**Lab complete.** Confirm every checkpoint above before you move on.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uptiq.ai/academy/tier-2-core-skills/m03-agent-builder-fundamentals/lab-3-configure-knowledge-triggers-secrets-and-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
