Test an agent and read its logs with the Newo CLI

Check a change before your customers meet it, and find out why an agent answered the way it did. The CLI chats with an agent through the sandbox, runs scripted conversations with expected answers, and reads the transcript and execution log of any session.

Before you begin

:::
Important

A sandbox chat runs the real agent. Unless the conversation runs in test mode, a booking, order, transfer, SMS, or email it makes is real. Cancel anything a test created.
:::

Chat with an agent in the sandbox

  1. Send the first message:
newo sandbox "Hi, can I book a table for two?" --json
  1. Read response, actor_id, session_id, and external_event_id from the JSON output.
  2. Continue the same conversation with the actor ID:
newo sandbox --actor [actor_id] "Tomorrow at 7pm" --json

When the account has more than one sandbox connector, add --connector [connector_idn]. The CLI waits up to 60 seconds for a reply. Raise that with --timeout [seconds] for a slow turn.

The sandbox is a chat. It can't test phone calls, voice, SMS, or email. For those, make a real call or send a real message, then read its logs.

Run a scripted test

A scenario file holds the messages to send and what each reply has to contain.

  1. Write the scenario:
name: order status happy path
timeout: 90
turns:
  - message: 'Hi'
    expect:
      contains: 'Hello'
  - message: 'Where is my order 123?'
    expect:
      contains: ['order', '123']
      not_contains: 'error'
      regex: "order\\s+#?123"
  1. Run it:
newo test ./scenarios/order-status.yaml

The command exits with code 0 when every turn passes and code 1 when one fails. A failed turn stops the run, and the remaining turns are reported as skipped. Add --json for a per-turn report.

Every turn runs in one shared conversation. Like a sandbox chat, a scripted test is live, and it leaves its test conversation behind in the account.

Read a conversation

newo conversations                              # phone conversation history, under newo_customers/
newo session [session_id]                       # one conversation: transcript, thoughts, system events
newo logs --session-id [session_id] --raw       # every skill call, model call, and event
newo logs --event-id [external_event_id] --raw  # one turn only

Start with newo session. It's the fastest view of what the customer said, what the agent answered, and what it was thinking. Add --full for the skill-by-skill execution trace.

To connect a sandbox turn to its log entries, pass the external_event_id from the sandbox output to newo logs --event-id.

Find out why an agent behaved a certain way

Start from the errors, then narrow down:

newo logs --level error --hours 24
newo logs --flow [flow_idn] --skill [skill_idn] --hours 6
newo logs --from "2026-01-11T00:00:00Z" --to "2026-01-12T00:00:00Z" --message "booking"

Without a time option, newo logs covers the last hour. A query by session, event, or context ID has no time window.

In a log entry:

  • data.name is the action that ran, and data.result holds its result.
  • --skill, --flow, and --name filter by skill, flow, and action name.
  • Subscriptions not found is normal. It means an event had no listener.

An empty result doesn't prove that something never happened. Widen the time window first, and raise --max when the output says it reached the entry limit.

Keep customer data safe

Transcripts and logs contain your customers' names, phone numbers, and what they said. Query only what the task needs, and summarize a result instead of copying it into other tools.

The CLI replaces API keys, connector credentials, and secret attribute values with [REDACTED] in everything newo logs prints. --show-secrets turns the masking off.


Did this page help you?