Skip to main content

AI in agents

Audience: agent builders who want agents to read, write, classify and decide with large language models, safely and within budget.

Contents​

  1. What you can do with AI
  2. Set up a model connection
  3. Generative AI steps
  4. Prompt Skills
  5. AI agents that use your agents as tools
  6. The web goal agent
  7. Knowledge Q&A
  8. Document extraction with validation
  9. The Studio assistant
  10. Good practice: masking, budgets, testing
  11. If it goes wrong
  12. Related guides

1. What you can do with AI​

The AI section of the Actions panel has four groups:

GroupUse it to
Generative AIPrompt a model; chat; work with pictures; summarise, classify, translate, extract fields, sentiment, language, key phrases, named entities, personal data; generate pictures
Prompt SkillsRun a reviewed, reusable prompt by name
Knowledge Q&AAnswer questions from your own documents, with citations
AI agentsLet a model reach a goal by calling your agents as tools

The Web goal agent (under More toolkits) works a web page towards a goal you describe.

Supported providers: OpenAI, Azure OpenAI, Anthropic, an OpenAI-compatible server (local or hosted, for example Ollama), Hugging Face, Amazon Bedrock, a model on an Amazon SageMaker endpoint, and Google Vertex AI.

2. Set up a model connection​

Instead of repeating the provider, model and key on every step, name the settings once as a model connection.

In Studio (for your local runs):

  1. Open the Theme and density menu (sun icon) in the top bar and choose Model Connections….
  2. Click + Connection. For each connection set:
    • a name (for example gpt), and Default for the one used when a step names none;
    • Provider and Model (for example gpt-4o-mini);
    • API key from: Environment variable (its name, such as OPENAI_API_KEY), Credential vault credential (vault folder/credential/attribute) or No key (local model);
    • Endpoint (optional): for Azure or a local server.
  3. Click Save. The settings go to model-connections.json in your workspace; keys are never stored there, only where to find them.

In One CommandCenter (for runs on runners): Manage > Model Connections. Administrators also set which roles may use each connection, monthly token budgets, call limits, personal-data detection and content checks. Runs receive the connections they are allowed to use.

In a step: AI steps have a choice Model to use: A saved connection (type its name in Connection) or Set up here (Provider, Model, API key, Endpoint address, and for Bedrock AWS access key id and AWS region).

3. Generative AI steps​

ActionMain fieldsGives
PromptPrompt, System (instructions)The answer text (or JSON with Response format)
ChatMessage, Chat session, System, ImagesThe reply; the session remembers earlier turns until End chat
Prompt with picturesPrompt, ImagesThe answer about the pictures
SummariseText, SentencesA summary
ClassifyText, Labels (a list such as ["urgent","normal","spam"])The chosen label
Extract fieldsText, Fields (name to description)A Dictionary of values (see section 8)
TranslateText, Target languageThe translation
Sentiment, Detect language, Key phrases, Named entitiesTextThe result
Detect personal dataText, Kinds, Mask style, Use AIEach email, phone, card, IBAN, IP address, SSN, PAN or Aadhaar number found (checked by its check digit where it has one) and a masked copy of the text; needs no model unless Use AI also looks for names and addresses
Generate picturePrompt, Output folder, Number of imagesPicture files

More options include Temperature (0 is the most predictable), Max tokens, Hide personal data and Timeout seconds.

Example: sort support emails.

  1. Find emails and loop over them; Read email into $email.
  2. Classify with Text ${email.subject}\n${email.text} and Labels ["billing","technical","sales"]; save the label in $category.
  3. If $category equals billing → Move email to the Billing folder; and so on.

The sample agent O5-ai-ticket-triage in examples/use-cases (and the Sorting support tickets with AI template) is a complete version.

4. Prompt Skills​

A Prompt Skill is a prompt that someone has written and reviewed once, kept as a named item, and run by many agents.

AI in agents
Prompt Skills in One CommandCenter.

Create one in Studio:

  1. + Create > Prompt Skill, give a name (for example invoice_summary). It goes into the ai-skills folder.
  2. In the designer:
    • Description: what the skill does; shown in the Prompt Skills list.
    • Instructions (system): the role and rules for the model.
    • Prompt template: the prompt, with ${name} where values go. The placeholders found are shown as chips.
    • Model: Provider, Model, Temperature, Base URL (optional).
    • Answer format: Text or JSON (Dictionary).
    • Mask personal data (emails, phone numbers, card numbers) before sending (on by default).
  3. Save (Ctrl+S).
  4. Click Copy as an agent step, open an agent and press Ctrl+V: you get a Run Prompt Skill step with Skill set and one Values entry per placeholder. Fill them in, for example {"text": "$invoice_text"}.

API keys never go into skill files: give the step a Connection, or an API key credential.

In One CommandCenter (Build > Prompt Skills), skills are shared, versioned and can start from templates. A skill kept there wins over a file of the same name in a runner's workspace.

5. AI agents that use your agents as tools​

Run AI agent (group AI agents) gives a model a goal and a set of your agents as tools. The model decides which tools to call, in which order, with which inputs, until the goal is reached.

  1. Build small, well-described agents to act as tools, for example lookup_order and check_refund_policy. The model reads each agent's Description and its input and output descriptions, so write them carefully.
  2. Add Run AI agent:
    • Goal: what to achieve, for example "Handle this customer email: ${email.text}".
    • Instructions: rules ("You are a careful business assistant. Use the tools to act; never invent results." by default).
    • Tools: the agent ids, ["lookup_order", "check_refund_policy"].
    • Model to use: a saved connection or set up here.
    • More options: Sensitive tools (agents that need a person's approval before each call, such as issue_refund), Role, Action plan (the order to use the tools and when to stop, in plain words), Output fields (values it must return, name to description), Allow cancel, Max steps (8), Max tokens total (60000), Max duration seconds, Temperature, Hide personal data.
  3. Outputs: answer, status (completed, limit_reached or stopped; with output fields also failed or cancelled), outputs, trace (each model turn and tool call, for review) and tokens.

Check the tool agents in to One CommandCenter too.

Approvals when nobody is at the runner. In an unattended run, a sensitive tool is refused at once, unless you name approvers (user:NAME or role:NAME, separated by commas). Then the request goes to their Task inbox: the AI agent names the tool and its arguments, and waits up to approval_timeout_seconds (at most 1700). Approved, the tool runs. Rejected or unanswered, the agent is told no and does not try again. A comment the approver writes is kept in the run's log. When approval links are on (Administrator's guide), approvers can also answer from e-mail, Teams or their phone.

Knowledge the agent looks up itself. Give knowledge_indexes (indexes made with Knowledge Q&A > Build index, section 7). The agent gets a search_knowledge tool: it searches them when it needs a fact or a rule, and the passages it finds go back to it with their sources.

Tools of other systems (MCP). Give an mcp_server_url (a server that speaks the Model Context Protocol over HTTP) and its mcp_token when it needs one. The server's tools are offered to the agent as mcp_NAME. mcp_tools limits which ones (empty: all), and naming a tool as mcp:NAME in sensitive_tools makes it need approval like a sensitive agent. The MCP tools toolkit lists a server's tools (List MCP tools) and calls one directly (Call MCP tool), outside an AI agent. One CommandCenter also offers your agents to outside assistants as an MCP server, the other direction.

6. The web goal agent​

The Web goal agent works a web page for you: it looks at the page and clicks, types, selects, scrolls and goes to addresses until the goal is reached.

  1. Start web agent session: Address (URL), Browser, Headless.
  2. Reach a goal:
    • Start url and Goal in plain words, for example "Search for invoice ${invoice} and tell me its total and due date.";
    • Secrets: name to Credential, for example {"password": "$portal_password"}. The model types them as {{secret:password}} and never sees the values. Vault attributes marked Password fields only are typed into password fields only;
    • tick Return the findings in a fixed shape for structured results;
    • More options: Allowed sites (host names it may visit; any site when empty), Instructions (for example "Never press Delete or Pay."), Max steps, Hide personal data, Save trajectory to.
  3. End web agent session.

Outputs: success, answer, data, steps (each step in words), url, and the tokens used.

Tip: Always set Allowed sites and clear rules in Instructions for goal agents that can change data.

6a. Decision tables (business rules)​

Keep rules that change, such as approval limits or discounts, in a decision table instead of If steps. The Business rules toolkit's Evaluate decision table reads it from a CSV file, which you can keep and edit in Excel (Save As > CSV), or from a table value. The header row names the columns:

  • in:NAME: a condition on the input NAME;
  • out:NAME: what a matching rule gives;
  • rule (optional): the rule's name, returned as rule.

A condition cell is empty or - for any value; a value for equal (numbers as numbers, text without regard to case); <1000, <=1000, >1000, >=1000 or !=EU; a range 1000..5000 (both ends included; [1000..5000) leaves the upper end out); a list EU, UK; or not EU, UK. For example:

rulein:amountin:regionout:approver
small<1000-team lead
eu large1000..50000EU, UKfinance manager
large1000..50000-controller
huge>50000-CFO

Hit policy says what happens when several rules match: first (the first in order, the default), unique (exactly one must match, else the step fails with RULES.NOT_UNIQUE) or collect (all of them, in all). With no match the step gives default_outputs, or fails when fail_when_none is ticked.

6b. Finding controls by sight (AI screen)​

For screens without usable selectors, such as remote desktops, Citrix and VDI sessions, or applications that draw their own controls, the AI screen (vision) toolkit finds a control from a plain description with a model that reads pictures:

ActionWhat it does
Find on screen (AI)Takes a screenshot, asks the model where "the Submit button below the address" is, and returns found, the middle (x, y), the box, the model's confidence and the text it reads there
Click described control (AI)The same, then a single, double or right click. Below min_confidence (0.7 at first) it fails with VISION.NOT_FOUND instead of clicking
Type into described control (AI)Clicks into the described field and types the text (pasted, so any language works)
Read described control (AI)Returns the text of the described control

Describe the control by its text, kind, colour or place. When several match, the model is asked to answer "not found" rather than guess. The screenshot is made at most 1600 pixels wide before it goes to the model, and the model's answer is checked to lie inside the picture before anything is clicked. Personal-data masking does not apply to pictures, so use a model connection your company allows for screen content. Keep captured objects for screens that have them: they are faster, cost nothing per step and need no model.

7. Knowledge Q&A​

Answer questions from your company's documents:

  1. Build index: Files (files and folders: text, Markdown, HTML, CSV, JSON, XML, Word .docx and PDF) and/or Texts you already have; Index file (for example knowledge/policies.json). Choose Search by meaning too (a connection with an embedding model) to find passages by meaning, not only by words. Rebuild when documents change.
  2. Search: Index file, Query, Top k: returns the best passages.
  3. Ask: Index file, Question, Model to answer with: the model answers from the passages only, cites them like [1], and says when the documents do not cover the question. When nothing matches, the model is not called.

Keep the index file in One CommandCenter's repository files so runners get it with the run.

8. Document extraction with validation​

8.1 Extract fields​

Extract fields takes Text and Fields, a Dictionary of name to description:

{"invoice_number": "the invoice id", "total": "amount due as a number", "due_date": "due date as yyyy-mm-dd"}

and returns fields, a Dictionary of values. Read them as $fields.total.

Get the text first: PDF > Extract text for digital PDFs, OCR for scans, Word > Extract text from a file, or the body of an email.

8.2 A document intelligence item​

  1. + Create > Document intelligence, name it (for example Supplier invoice).
  2. Under Document type: Name, Description, AI provider, Model and Accepted files (PDF, TXT, CSV, XML, JSON, MD, HTML).
  3. Under Fields to extract, click + Field for each value: Field, What to extract (described for the AI), Type (String, Number, DateTime, Boolean, List) and Required.
  4. Under Use it, click Create extraction agent. Studio creates extraction, an agent with inputs document (File) and api_key (Credential) and the output fields. It reads PDFs with Extract text and other files as text, then calls Extract fields.

8.3 Let a person check unsure values​

Set Min confidence (More options of Extract fields), for example 0.8:

  • confidence gives, per field, how sure the model is (0 to 1);
  • needs_review is true when any field is below the threshold;
  • validation holds the values, the confidence and the threshold.

When the agent runs from a work queue and returns validation as an output named validation, the item waits as To validate in One CommandCenter. A person opens Validate, sees the unsure fields in red, corrects them and Approves (the item goes back to the agent with validated_fields) or Rejects it.

8.3a Route, extract by rules, and learn from corrections​

The Document processing toolkit works on a document's text (read it first with the PDF, OCR or Word toolkits):

ActionWhat it does
Classify documentDecides the document type from a list such as [{"name": "invoice", "keywords": ["invoice", "VAT", "amount due"], "description": "a supplier invoice"}]. keywords counts each type's words; ai asks the model with the descriptions; keywords_then_ai (the default) uses the keywords when the best type reaches min_score and leads, and asks the model otherwise. A type the model names that is not in the list counts as unknown
Extract by rulesPer field, a regex (its first match, or its first group) or after a label (the rest of the line, up to until). No AI: nothing leaves the runner. Fields not found are in missing
Save validated exampleAfter a person checked the values (for example in To validate), keeps them with the start of the document's text in an example file per type (the newest 50)
Extract with examplesExtracts with AI and sends the newest max_examples examples of the same type with the request, so the model follows how your documents are read and gets better as people correct it

8.4 Ready-made cloud AI services (AWS, Azure, Google)​

If your company already pays for a cloud provider's AI services, three toolkits call them directly, with no REST set-up. Each starts with Connect (keys come from the vault, never typed into the step); the other steps use that session.

ToolkitConnect withSteps
AWS AI services (ooa.aws_ai)Region, access key id and secret key (and a session token for temporary keys). Check now confirms the keys with a free identity check.Comprehend: sentiment, entities, language, personal data (with a masked copy). Textract: text of a scan; forms and tables, each table as a Data Table. Rekognition: labels and text in a picture.
Azure AI services (ooa.azure_ai)The resource's endpoint and key (or a Microsoft Entra access token).Language: sentiment, entities, personal data. Document Intelligence: read any document; analyse invoices, receipts or layout into fields, key and value pairs and Data Tables. Vision: caption, tags, objects and text of a picture.
Google Cloud AI (ooa.google_ai)An API key, or an OAuth access token; the project and location (us or eu) for Document AI.Natural Language: sentiment, entities. Vision: labels, text (OCR). Document AI: send a file to any processor and get its text, entities, form fields and tables.

Good to know:

  • Files are read from the run's workspace. Each step names its size limit (for example 5 MB for Rekognition, 10 MB for Textract, 50 MB for Document Intelligence) and fails with a clear error when a file is too large or missing.
  • Azure Document Intelligence works in the background: the step waits for the result, up to timeout_seconds (120 by default), and then fails with AZURE_AI.ANALYSIS_TIMEOUT, which a retry can repeat.
  • Document AI does not take API keys; connect with an access token of a service account.
  • Errors start with AWS_AI., AZURE_AI. or GOOGLE_AI.. AUTH_FAILED and FORBIDDEN say how to fix the sign-in; RATE_LIMITED, THROTTLED and SERVER_ERROR are marked retryable, so a step's retry policy can try again.
  • The text and files go to the provider's cloud: check that this is allowed for the data before you use these steps, and prefer Detect personal data / Find personal data to mask text before sending it elsewhere.

9. The Studio assistant​

The Assistant button in the top bar opens Agent assistant with two tabs:

  • Build from a description: describe the job ("Read invoices.csv, and for every row with amount above 1000 send an email to approvals@company.com with the invoice number"), choose a Model Connection and click Generate steps. Review the proposed steps and click Insert into the agent. They go where the canvas hint says; new variables come with them. Problems to fix are listed. Always review before running.
  • Explain this agent: the agent in plain words (what it needs, what it returns, each step). Copy puts it on the clipboard, handy for documentation or a hand-over. Word (.docx) downloads a design document for the agent: its purpose, inputs, outputs and variables, the toolkits it uses, its steps in plain words (main steps, each subflow, the error handler) and a table of every step's settings. Credential defaults are never written into it. Print or PDF opens the same document for printing; choose Save as PDF as the printer to get a PDF. Explain this agent works without a model connection, and so do both exports.

The assistant needs a model connection; without one it offers Set up a Model Connection.

While Studio is signed in to One CommandCenter, the company's settings answer instead: the dialog says "Uses One CommandCenter's settings for the Studio assistant", and no connection of Studio's own is needed. An administrator sets them in Settings › AI assistants › Studio assistant:

SettingWhat it does
ModelThe One Model Connection used by default. Empty: the person's first allowed connection
Models people may chooseOthers a builder may pick in My account › AI assistants
Creativity0 to 1. 0 (the default) gives the same steps for the same request
Longest answer100 to 8,000 tokens; 4,000 by default
Answer languageThe language of step names and notes; command names, variables and values stay as they are
Company instructionsRules the model gets before every request, such as naming rules or preferred commands (up to 2,000 characters)
Prompt Skills it may useShared Prompt Skills whose text the model also gets
People may add their own instructionsBuilders add theirs in My account; they come after the company's and never replace them
Tokens per personThe most tokens one builder may use with the assistant each month, in thousands; 0 (the default) leaves only the Model Connection's budget
Wait for an answer30 to 600 seconds; 300 by default
Mask personal data before the modelOff by default, as before; on hides personal data in the request from the model

The company's Model Connection then applies its masking, budget and the record of each call (the call shows in AI governance as "Studio assistant"). Studio still checks every suggested step before it shows it, and the assistant only suggests: it never saves, checks in or runs anything. Studio on its own (not signed in) keeps using its own Model Connections, as before.

When an administrator has chosen the OneChat service as One Chat's engine (Settings › AI assistants › One Chat › Engine), the service answers Studio's assistant too, with the agent open in Studio as context. It works for development only: it may read Studio's commands, check steps and see the agents you may call, and it calls models with the settings above. Studio still checks what it suggests. When the service can't answer, the Studio assistant's own Model Connection answers instead, and the notes start with a sentence saying so.

A OneChat model can also be one of your Model Connections: an OpenAI-compatible connection whose model is ooa-flow-assistant (Auto), ooa-flow-assistant-fast, -smart or -ultra. Settings › AI assistants › Studio assistant shows whether that model was built for this release's actions. With Send results to the OneChat model for training on (off by default), Studio tells it whether the builder inserted or discarded each suggestion.

10. Good practice: masking, budgets, testing​

  • Mask personal data. Keep Hide personal data on (it is on by default for AI agents and Prompt Skills): email addresses, phone numbers and card numbers are replaced before the text leaves, and put back in the answer. Administrators can add a Presidio analyzer for names, places and IDs.
  • Send only what is needed. Extract the relevant part of a document before prompting; never send whole mailboxes.
  • Keep keys in the vault. Use connections or Credential variables, never keys in steps or skill files.
  • Mind the budget. Connections in One CommandCenter have monthly token budgets and call limits; past them, steps fail with AI.BUDGET_REACHED or AI.CALL_LIMIT. Set Max tokens, Max steps and Max tokens total.
  • Make answers predictable. Use temperature 0, Classify with fixed labels, Extract fields with clear descriptions, or JSON answers, rather than free text that later steps must parse.
  • Check before acting. Use Min confidence and work-queue validation, approvals for sensitive tools, and If steps that check a value is sensible before it is used.
  • Test with variety. Run the agent on several kinds of input and compare the answers; check outputs with contains or a range rather than an exact text, since AI answers are worded differently each time.
  • Audit. Every AI call of a run is listed in its AI calls tab and in AI governance; prompts and answers are never stored, only fingerprints.

11. If it goes wrong​

What you seeCause and fix
The assistant says it needs a language modelSet up a connection in Model Connections….
"API keys are never stored in connections" when savingPoint to an environment variable or a vault credential instead of typing the key.
An authorisation error from the providerThe key is wrong or expired, or the environment variable is not set for ONEOFFICEAUTOMATION.
AI.BUDGET_REACHED / AI.CALL_LIMITThe connection's monthly budget or per-run limit is used up. Ask your administrator.
AI.CONTENT_FLAGGEDThe provider's content check flagged the answer. Review the input.
Extract fields returns empty valuesThe text is empty (a scanned PDF needs OCR) or the field descriptions are vague.
The AI agent stops with limit_reachedRaise Max steps or Max tokens total, or give a clearer Action plan.
The web goal agent wanders to other sitesSet Allowed sites.

Knowledge bases kept in One CommandCenter​

Instead of each agent carrying its own index file, keep shared documents in a knowledge base: make it in Build > Knowledge bases (a name, the folder whose agents may use it, what it holds), then:

  • Fill and refresh it with an indexing agent: Knowledge Q&A > Build index with Knowledge base set to its name. It reads files and folders (a share, a synced SharePoint library), web pages (intranet or public pages: HTML, text or PDF) and texts. Schedule that agent (for example every night) so the base stays current; the list shows when it was last refreshed and by which agent.
  • Ask it from any agent in its folder: Search or Ask with Knowledge base set. A runner fetches the base once and again only when it has changed.
  • In Studio without One CommandCenter, the same steps keep the base in the work folder (knowledge-bases/), so agents can be tried before they are published.