Joule Studio and AI Agents
BTP & Integrationbeginner

Joule Studio Part 2: Build Your First Custom Joule Agent

Key takeaway

Walk through building a Joule agent end to end: prerequisites (BTP entitlements, destinations), defining the agent's goal and instructions, adding a skill as a tool, testing in the studio, and deploying so it's reachable from Joule. Principal propagation carries the calling user's identity through every skill and service call automatically.

Explanation

📌 KEY POINTS
✅ Prerequisites: the right BTP entitlements/subaccount setup, and destinations configured for any back-end system the agent's skills will call.

✅ An agent is defined by a goal/instructions (what it should accomplish and how) plus a set of tools — typically skills you or others have built.

✅ Principal propagation is enforced automatically: the calling user's identity passes through to every skill and CAP service call, so back-end authorizations apply per user, not per shared technical account.

✅ Test the agent inside Joule Studio before deploying — conversational testing surfaces gaps in instructions early.

⚠️ An agent with vague or overly broad instructions will improvise in unpredictable ways; specific, bounded instructions produce reliable behavior.

━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE

Part 1 explained the landscape. Now building.

━━━━━━━━━━━━━━━━━━━━
▶ 1. PREREQUISITES

  • BTP entitlements, destinations.

━━━━━━━━━━━━━━━━━━━━
▶ 2. GOAL AND INSTRUCTIONS

  • What the agent should do, and its boundaries.

━━━━━━━━━━━━━━━━━━━━
▶ 3. TOOLS

  • Skills (and other agents) the agent can call.

━━━━━━━━━━━━━━━━━━━━
▶ 4. PRINCIPAL PROPAGATION

  • Automatic, per-user identity through the call chain.

━━━━━━━━━━━━━━━━━━━━
▶ 5. TEST AND DEPLOY

  • Conversational testing in studio, then deployment.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

  1. Configure destinations for the back-end systems involved.
  2. Define the agent's goal and add one skill as a tool.
  3. Test conversationally in the studio, then deploy.

✅ CHECKPOINT: a test user with limited authorizations gets correctly limited results from the agent.

Code example

ABAP Code
===== AGENT DEFINITION (conceptual) =====Goal: "Help employees check the status of their IT support tickets and create new ones."Instructions: "Only discuss tickets belonging to the requesting user. If asked about another user's ticket, decline and explain."Tools: [GetTicketStatusSkill, CreateTicketSkill] ===== IDENTITY FLOW =====User asks Joule → Agent invoked → Skill called → CAP service called  (user's identity propagated automatically at every step — no shared technical user) ===== TEST THEN DEPLOY =====Test in studio with a real, limited-privilege test user → verify authorization boundaries → Deploy

Real project scenario

A team built an agent with the instruction "help with HR questions" and no boundaries; it began answering questions about other employees' compensation because a poorly scoped skill technically allowed the lookup. Tightening both the instructions and the underlying skill's authorization fixed it — a reminder that instructions alone aren't a security boundary.

Common mistakes

  • Vague, unbounded instructions.
  • Testing only with admin/privileged accounts.
  • Assuming instructions alone enforce security (they don't — the underlying skills and back-end authorizations do).
  • Skipping destination configuration until deployment fails.
  • Deploying without conversational testing.

Best practices

  • Write specific, bounded instructions.
  • Test with realistically-scoped users.
  • Enforce security in skills/back-end authorizations, not just instructions.
  • Configure destinations early.
  • Test conversationally before deploying.

Interview angle

Questions: "What are the prerequisites for building a Joule agent?", "How does principal propagation work in Joule Studio?", "Why isn't an instruction like 'only show the user's own data' sufficient on its own for security?"
Strong answer: prerequisites, goal/instructions/tools structure, automatic principal propagation, the limits of instructions as a security control, test-then-deploy discipline.

Practice this lesson

Quick check

1. Why is a human approval step important for an agent proposing a consequential action?

2. Why does an agent need explicit action boundaries in its instructions?

3. A maintenance agent could identify missing spare parts but had no way to actually order them. What is missing?

Interview questions

1. A production issue is reported in Joule Studio and AI Agents around Joule Studio and AI Agents: Beginner Concepts. How would you troubleshoot it systematically and avoid the common failure patterns?

Answer it in your own words first, then compare.

2. You are the senior consultant/architect responsible for Advanced Joule Studio and AI Agents: Architecture, Integration and Production Design. The project situation is: A maintenance agent could identify missing spare parts but originally had permission to create purchase orders directly. How would you assess the design, identify the highest-risk failure modes, and define the evidence required before approving it for production?

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics