How does Replit Agent build and deploy apps?

Replit Agent is a software-building agent that acts on plain-language requests. It sets up projects, creates apps, checks its work, and fixes problems. Its role spans planning through deployment.1
Agent can run code as part of its reasoning process.2 It works from your instructions and context, not an automatic grasp of your goals. You still decide whether the result matches your intent.3
How does Replit Agent differ from chat and autocomplete?
A chatbot mainly responds; an agent can use tools and act.3 Replit Agent handles code writing, infrastructure setup, and database configuration.1
Replit's Ghostwriter Complete Code tool shows suggested code as ghost text. Its Generate Code tool takes custom prompts on demand. Ghostwriter Edit Code shows line-by-line changes for users to accept or reject.4
When choosing your workflow, decide: do you want suggestions or delegated work? For delegated work, state the required result and review it before release.
How does the execution loop work?
1. Describe the goal and review the plan.
Agent works from the instructions and context you provide.3 Plan mode lets you review and revise its plan before building.1
2. Gather context before making changes.
Replit's Agent v2 description says it forms hypotheses and searches for relevant files. It starts making changes only once it has enough information.5
3. Set up the project and write code.
Agent sets up projects and creates applications.1 It can work with session-created files and produce single-file outputs.2
4. Run, check, and revise.
Agent can execute code while reasoning, even before you choose to build.2 It checks its work and fixes problems along the way.1
Treat plan approval as a chance to pin down scope. Ask for the main screens, data needs, and rules before approving the build. Then compare the result with those requirements, rather than judging only its appearance.
How are infrastructure, databases, and deployment connected?
Agent handles infrastructure setup and database configuration alongside writing code. Replit describes its scope as running from planning to deployment.1
In the editor, Shell, and Agent sessions, DATABASE_URL points to the development database. Replit connects it automatically; on current infrastructure, it does not appear in Secrets.6
A published app gets a separate DATABASE_URL for its production database. The published app runs with REPLIT_DEPLOYMENT=1. Seeing REPLIT_ENVIRONMENT=production in the Shell does not mean the workspace uses production data.6
Agent can edit the development database, but cannot modify production directly. It reads production through an up-to-date, read-only copy called a read replica.6
At publishing, Agent's development database structure changes are applied to production. Publishing uses drizzle-kit to apply changes to tables, columns, indexes, constraints, views, and row-level security policies.6
Review proposed database structure changes before publishing. Do not treat the block on direct production edits as a reason to skip that review.
Where should developers use Replit Agent?
Replit lists web apps, mobile apps, data dashboards, and AI-powered tools as supported outputs. It also lists visual prototypes and multiple outputs sharing one backend. Connected queries can pull data from services such as BigQuery, Linear, Slack, and Notion.1
For a prototype or minimum viable product, start with one narrow user task. Define what success means before asking for more screens or features. Use the first build to test that task, not as proof of production readiness.
Hypothetical example: ask for an internal sales dashboard with filters and a weekly summary. In Plan mode, request a plan for the screens, data source, and access rules. Review those choices before allowing the build to proceed.
Judge Agent against three needs: a clear plan, the required setup, and a reviewable result. Favor a small first scope when you can describe and check each outcome. Bring in manual engineering review for the parts you cannot verify yourself.
What must be checked before production handoff?
Replit warns that working code and correct code are different things. It calls for review of authentication, data handling, and trust boundaries.7
Under Replit's shared responsibility model, users must verify Agent output through code review. That includes correctness, security, licensing, and third-party dependencies it adds.7
Users are responsible for penetration testing their applications.7 Compliance for the app you build also remains your responsibility.8
By default, a rollback does not change your database. To restore the development database, select Database under Additional rollback options. This rollback feature does not automatically restore production data.9
For handoff, request reviewed code, a record of database changes, and a recovery plan. Set separate approval points for app behavior, access rules, and production data changes. Treat Agent's build as work to verify, not as release approval.
Sources
- docs.replit.com › overview
- docs.replit.com › general-agent
- docs.replit.com › introduction-to-ai
- blog.replit.com › ghostwriter-inline
- blog.replit.com › agent-v2
- docs.replit.com › development-and-production
- docs.replit.com › shared-responsibility-model
- docs.replit.com › deployment-and-publishing
- docs.replit.com › checkpoints-and-rollbacks


