Testing an agent

Test an agent in the test harness of your authoring session in Cloudera Agent Studio to confirm that the agent responds as you expect before you publish it.

The agent editor has a Test button. When you click Test, Agent Studio opens the test harness of your authoring session in a new browser tab. The test harness is a chat interface in which you send messages to the agent and review the responses. The Testing Mode badge in the header identifies the test harness.

The test harness consists the following areas:

  • The chat area, which shows the conversation and the message box.
  • The session list in the left pane, which holds your test chats.
  • The Agent, Canvas, Todos, and Space tabs in the right pane.
  • Make sure that your user has the Admin or Builder role, which includes the test_authoring_playground action. For more information, see User roles and capabilities.
  • Create the agent. For more information, see Creating an agent.
  • Make sure that the agent passes validation. For more information, see Validating an agent.
  • Make sure that an LLM endpoint is available for the agent. For more information, see Managing LLM endpoints.
  • Make sure that your browser allows Agent Studio to open pop-up windows. If the browser blocks the new tab, the test harness does not open.
  1. Launch the Cloudera Agent Studio console.
  2. In the left navigation pane, click Assets > Agent Catalog.
  3. In the list of agents, open the Actions menu of your agent, and then click Edit.
    If an authoring session is not ready, a progress dialog opens. Wait for the dialog to close. The agent editor opens.
  4. In the header of the agent editor, click Test.
    The test harness opens in a new browser tab and displays a message box named Message agent name…, where agent name is the name of your agent. If Agent Studio cannot open the test harness, a Test harness is not ready yet or Could not open the test harness message is displayed. Pause briefly, then select Test again. If the page displays the banner External hosts accessible during testing may be blocked after deployment, add each required external host to egressRules in config.json. Set specVersion to 1.2.0 for egressRules.
  5. Optional: In the message box, click the mode list, and then select how the agent acts. You can also press Shift+Tab to switch the mode. The default mode is Ask.
    • Ask requires you to approve each change before the agent acts.
    • Auto acts without asking you first.
    • Plan researches the task and proposes a plan first.
  6. Optional: In the message box, click the model list, and then select the model that the agent uses for the test.
    The list marks the default model with (default).
  7. Optional: In the message box, click the Space list, and then select a Space.

    Enter text in the Search field to find a Space. The default selection is No Space.

    Select a Space before you send the first message of a chat. A Space gives the agent access to its files. You cannot change the Space of a chat after you send the first message.

  8. In the message box, enter a message for the agent, and then press Enter or click the send button.
  9. Review the response of the agent in the chat area.
  10. Optional: In the right pane, click a tab to inspect the test:
    • Agent shows a diagram of the agent, including its Model Context Protocol (MCP) servers, skills, model, and sub-agents.
    • Canvas shows the charts, diagrams, and files that the agent produces. Before the agent produces any items, Nothing on the canvas yet is displayed.
    • Todos shows the steps that the agent breaks its work into. Before the agent creates a plan, No plan yet is displayed.
    • Space shows the Space that the chat uses. When the chat has no Space, This chat has no Space is displayed.
  11. Optional: Click Context in the header of the chat to check how much of the context window the conversation uses.
    The Context window panel shows the number of tokens used, Messages, Input tokens, Output tokens, Cost and the auto-compact threshold. To compact the conversation, click Compact now. To revert the most recent compaction, click Restore last compaction.
  12. Optional: Click Settings in the header of the chat to review or change the permissions of the session.
    The Session settings dialog opens. Under Permissions, the RULES list shows the rules for the session. When the list has no rules, the agent allows read-only tools and asks you before running other actions. Click the close button to close the dialog.
  13. Optional: Click New chat to start a new test conversation.
  14. Close the test harness tab, and then return to the agent editor.

The test harness displays the response of the agent to your message. If the response does not match what you expect, update the agent in the agent editor. Test the agent again after updating it.