{"slug":"ai-agent","title":"How to vibe code an AI agent with Xpersona","shortTitle":"AI agent","goal":"build an AI agent","description":"Plan an AI agent with a job definition, tool boundaries, memory, run logs, failure states, and an inspectable first task.","audience":"Builders making repo helpers, research agents, support agents, internal operators, or task-specific AI assistants.","searchIntents":["how to vibe code an AI agent","build AI agent with OpenCode","AI agent setup key guide","Xpersona AI agent tutorial"],"firstPrompt":"Help me build an AI agent with Xpersona. Define the agent job, allowed tools, memory, run log, approval gates, failure states, and first OpenCode task.","buildPlan":["Give the agent one job and one type of output before adding tools.","Ask Xpersona for tool boundaries, approval gates, run logs, memory, and failure handling.","Build a first agent run that is inspectable before it changes anything important.","Add cost tracking, usage checks, and tighter permissions before expanding autonomy."],"pitfalls":["Calling a chatbot an agent before it has tools, state, or an inspectable run.","Giving broad write access before approval gates are clear.","Skipping run logs, which makes failures hard to debug."],"faq":[{"question":"What makes an AI assistant an agent?","answer":"An agent has a job, can take actions through tools, keeps enough state or context to complete the task, and produces inspectable runs."},{"question":"How should I start safely?","answer":"Start with read-only or dry-run behavior, visible logs, and explicit approval before writes or external actions."}],"canonicalUrl":"https://www.xpersona.co/vibe-coding/ai-agent","machineUrl":"https://www.xpersona.co/api/v1/guides/vibe-coding/ai-agent","provider":{"name":"Xpersona","baseUrl":"https://www.xpersona.co/v1","defaultOpenCodeModel":"xpersona/claude-fable-5","displayModelName":"Claude Fable 5"},"setupSteps":[{"name":"Describe the end goal","ui":"Guide input","description":"Write the thing you want to create in plain language. Keep it concrete: app, website, chatbot, dashboard, bug fix, or feature."},{"name":"Try the chat plan","ui":"Xpersona chat","description":"Open chat and ask Xpersona for the first build plan, files to edit, risks, and a tiny first milestone."},{"name":"Start free trial","ui":"Pricing","description":"When the plan is useful, start the 24-hour free trial so chat, setup keys, OpenCode, and /v1 clients are ready without choosing a monthly package up front."},{"name":"Create the setup key","ui":"Dashboard key page","description":"Create one private setup key. Treat it like a password and paste it only into tools you control."},{"name":"Choose Xpersona in OpenCode","ui":"OpenCode provider picker","description":"Open the provider screen, choose Xpersona, paste the setup key, and pick xpersona/claude-fable-5."},{"name":"Run the first repo prompt","ui":"OpenCode prompt","description":"Ask OpenCode for the smallest useful implementation step. Review the diff, run checks, and continue from the result."},{"name":"Check usage and keep iterating","ui":"Usage dashboard","description":"Use the dashboard to inspect requests, tokens, spend, and status after each real run."}],"recommendedLinks":{"guide":"https://www.xpersona.co/vibe-coding/ai-agent","hub":"https://www.xpersona.co/vibe-coding","chat":"https://www.xpersona.co/chat","pricing":"https://www.xpersona.co/pricing?checkoutTier=payg&returnTo=%2Fdashboard%2Fonboarding","opencode":"https://www.xpersona.co/opencode","dashboardOnboarding":"https://www.xpersona.co/dashboard/onboarding","usageDashboard":"https://www.xpersona.co/dashboard/usage","llms":"https://www.xpersona.co/llms.txt","llmsFull":"https://www.xpersona.co/llms-full.txt"}}