***

title: setPromptText
slug: /reference/typescript/agents/agent-base/set-prompt-text
description: Set the agent's system prompt as a raw text string.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ai-prompt]: /docs/swml/reference/ai/prompt

[swml-prompt-reference]: /docs/swml/reference/ai/prompt

[ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base

Set the agent's system prompt as a raw text string. This is the simplest way to
configure what the AI knows and how it behaves.

<Info>
  This sets the SWML [`ai.prompt`][ai-prompt] field. See the
  [SWML prompt reference][swml-prompt-reference] for details on prompt behavior.
</Info>

<Warning>
  Mixing raw text prompts with POM-based prompt sections (`promptAddSection()`) in the
  same agent may produce unexpected results. Use one approach or the other for the main
  prompt. Contexts can still be used alongside either approach.
</Warning>

## **Parameters**

<ParamField path="text" type="string" required={true} toc={true}>
  The complete system prompt text. Supports multi-line strings.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns `this` for method chaining.

## **Example**

```typescript {4}
import { AgentBase } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'support', route: '/support' });
agent.setPromptText(`
You are a customer support agent for Acme Corp.
You help customers with billing questions, order tracking, and returns.
Always be polite and professional.
`);
await agent.serve();
```