---
title: "Put an AI agent inside the app you build"
description: "Add an AI agent to the app you build as a chat, a button or a background job. Each signed-in user sees only their own chats, and you cap what it spends."
---

# Put an AI agent inside the app you build

Agents in apps puts an agent from Hercules Agents on your app's pages. Ask Hercules in the App Builder, and it builds the agent, the chat and the backend code behind it.

- **Chat, action or background job.** Pick how users reach the agent.
- **Spending caps.** Limit runs per user each hour and credits per rolling 24 hours.
- **Private chats in your database.** Each signed-in user sees only their own, saved in your app.

## What can an agent do inside your app?

### Reach users in a chat, a button or a background job

A chat shows the reply as the agent writes it, and an action runs the agent on what a user typed. A background job runs on a schedule and saves what it finds. [Agents in apps](https://hercules.app/docs/agents/agents-in-apps)

### Reuse an agent you already built

Any agent without the Dev box toolkit can run in your apps once you switch on Let apps run this agent. Then click Add to an app and choose Chat, Action or Background. [Agents in apps](https://hercules.app/docs/agents/agents-in-apps)

### Look up the user's own records

App tools are actions your app's backend offers the agent, such as looking up an order. Hercules Auth checks which signed-in user each call is for, so a tool reaches only that user's data. [Agents in apps](https://hercules.app/docs/agents/agents-in-apps)

### Act on the page

Page actions let the agent open a page or fill in a form for the user. They never submit a form, buy or delete, so give the agent an app tool for those. [Agents in apps](https://hercules.app/docs/agents/agents-in-apps)

### Choose which integrations users can reach

Every integration starts off in your users' runs until you switch it on. It runs on your own connection, so set it to Read only where reading is enough. [Agents in apps](https://hercules.app/docs/agents/agents-in-apps)

### Cap what it spends

Runs per user caps one user's runs per hour, 20 by default and up to 1,000. Daily spend limit caps all app runs over a rolling 24 hours, 500 credits by default and up to 100,000. [Costs and limits](https://hercules.app/docs/agents/costs-and-limits)

## How do you add an agent to your app?

### 1. Describe the job

> Add a chat to our customer portal that answers delivery questions and looks up the signed-in customer's orders.

Hercules proposes the agent's tools, page actions and limits, and waits for your yes.

### 2. Approve the plan

Say yes, and Hercules creates the agent and tests it with a few real messages and one it must refuse. It fixes the instructions until the answers are right, then builds the chat.

### 3. Add page actions, then publish

> Let the agent open an order's page when the customer asks about it.

Hercules adds the page action. If your app is already published, it asks you to publish first, because page changes go live only when you publish.

## What could an agent do for a business?

In this hypothetical example, an order assistant answers contractors' delivery questions in the portal of a plumbing supply wholesaler with 120 staff. A contractor asks about tomorrow's delivery, and the agent looks up their orders through an app tool and opens the order page. Contractors check deliveries without calling, so counter staff spend mornings on orders, not status calls.

## What should you know before you start?

- A background job your app starts runs with no user and uses the whole agent, including every integration.
- The agent runs only in apps on Hercules Auth 2.0. [Auth 2.0 upgrade](https://hercules.app/docs/apps/users-auth/upgrade-to-hercules-auth-2)
- Users can send text only.
- Runs for your users skip memory and Auto-improve, the feature that suggests fixes from past runs.
- App runs spend your organization's AI credits. [AI credits](https://hercules.app/docs/platform/billing/ai-credits)
- See what each plan includes on the [pricing page](https://hercules.app/pricing).

## Related features

- Use [Hercules Agents](/products/agents) to build the agent when you also want it on a schedule or in Slack.
- Use [Hercules Auth](/features/authentication) to sign users in, because the agent runs only for signed-in users.

## How do you get started?

Try one read-only job, such as order lookup, with two signed-in users before you publish. Start building.

## Frequently asked questions

### Can the daily spend limit be passed?

The daily spend limit can be passed, because Hercules checks it when each run starts. Runs in progress keep going, so the day's total can exceed the limit.

### What happens when a user reaches a limit?

When a user reaches a limit, the app's chat shows a short message instead of a reply. When your organization runs out of AI credits, it says the assistant isn't available right now.

### What do users see of the agent's tools?

By default, users see only that the agent is working, then its reply. Your app's backend still gets the full record, and Hercules can show tool details in the chat if you ask.

### Can Hercules change an agent it didn't create?

From the App Builder, Hercules edits only agents created from the app you have open. You change your other agents in the Agents console.

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Can the daily spend limit be passed?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The daily spend limit can be passed, because Hercules checks it when each run starts. Runs in progress keep going, so the day's total can exceed the limit."
      }
    },
    {
      "@type": "Question",
      "name": "What happens when a user reaches a limit?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "When a user reaches a limit, the app's chat shows a short message instead of a reply. When your organization runs out of AI credits, it says the assistant isn't available right now."
      }
    },
    {
      "@type": "Question",
      "name": "What do users see of the agent's tools?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "By default, users see only that the agent is working, then its reply. Your app's backend still gets the full record, and Hercules can show tool details in the chat if you ask."
      }
    },
    {
      "@type": "Question",
      "name": "Can Hercules change an agent it didn't create?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "From the App Builder, Hercules edits only agents created from the app you have open. You change your other agents in the Agents console."
      }
    }
  ]
}
```
