AI-Assisted Engineering

AI-Native Software Development: Designing Applications With Agents From Day One

Increasingly, the users of your application are not only people but AI agents acting for them. Designing for that from day one changes APIs, permissions, error handling, documentation and even pricing. This article sets out the design principles for AI-native applications: software that works well for humans and agents alike.

By EthicalHat Research · · 3 min read
Infographic: Designing an application for humans and agents

For most of software history, applications have had one kind of user: a person, clicking and typing. APIs served other programs, but those programs were written by developers who read documentation and handled errors deliberately.

That is changing. AI agents now book, buy, file, triage, query and update on behalf of people and teams. Some operate your UI through a browser; many more call APIs or MCP servers. Every SaaS product and internal application will increasingly be used by agents, and applications designed with that in mind work better, and more safely, for everyone.

Principle 1: expose capabilities, not just screens

Agents can operate web UIs, but it is slow, brittle and error-prone. Applications that expose their core capabilities through well-designed APIs, and increasingly through MCP servers, let agents act directly and reliably.

Design the capability layer first, and build both the human UI and the agent interfaces on top of it:

flowchart TB
  UI[Web / mobile UI<br/>for humans] --> CAP
  API[REST / GraphQL API<br/>for integrations] --> CAP
  MCP[MCP server<br/>for AI agents] --> CAP
  CAP[Capability layer<br/>business operations, validation,<br/>authorisation, audit] --> DATA[(Data)]

Principle 2: operations an agent can use correctly

Agents are users that read only your descriptions and error messages. Design operations accordingly:

  • Clear, typed inputs with enums, ranges and required fields, described in machine-readable schemas.
  • Descriptive names and documentation that say what an operation does, when to use it and what it returns.
  • Idempotency keys so retries (which agents do often) do not create duplicate orders or payments.
  • Reversibility where possible: drafts, soft deletes, cancellation windows.
  • Preview or dry-run modes so an agent can show a human what would happen before it happens.
json
{
  "name": "create_refund",
  "description": "Refund part or all of a captured payment. Use only after the customer has confirmed the amount. Returns the refund in 'pending' state; it can be cancelled for 10 minutes.",
  "inputSchema": {
    "type": "object",
    "required": ["payment_id", "amount_cents", "reason", "idempotency_key"],
    "properties": {
      "payment_id": { "type": "string", "pattern": "^pay_[A-Za-z0-9]{14}$" },
      "amount_cents": { "type": "integer", "minimum": 1 },
      "reason": { "type": "string", "enum": ["duplicate", "defective", "not_received", "other"] },
      "idempotency_key": { "type": "string", "maxLength": 64 },
      "dry_run": { "type": "boolean", "default": false }
    }
  }
}

Principle 3: errors that help the agent recover

"400 Bad Request" helps no one. Structured errors that say what was wrong and what is valid let an agent correct itself:

json
{
  "error": "amount_exceeds_refundable",
  "message": "Refund amount 12000 exceeds refundable balance 9950 for pay_8Kq2...",
  "refundable_cents": 9950,
  "retryable": false
}

Distinguish retryable errors (rate limits, timeouts) from permanent ones, and include rate-limit headers or fields.

Principle 4: delegated, scoped permissions

When an agent acts for a user, it should never get more access than that user, and usually much less:

  • support OAuth with fine-grained scopes, so users can grant an agent "read invoices" without "issue refunds",
  • record both the user and the agent on every action,
  • let users and admins see and revoke agent access, and
  • offer per-agent limits: amounts, volumes and allowed operations.

Principle 5: confirmation and accountability by design

For consequential operations, build the confirmation step into the application, not just into the agent:

  • operations can require human confirmation through a link, notification or in-app approval, with exact details shown,
  • audit logs record who, which agent, what, when and from where, and
  • notifications tell users when an agent acts on their behalf.

Principle 6: documentation for machines as well as people

Agents benefit from concise, structured documentation: schemas, examples and explicit rules. Some sites now publish machine-oriented summaries of their docs, such as the proposed llms.txt convention, alongside human documentation. At minimum, keep API reference docs accurate, versioned and example-rich.

Principle 7: design for abuse

Agents make automation easier for attackers too. Rate limits, bot detection for sensitive flows, anomaly detection per agent and per user, and protection of business flows (sign-ups, referrals, purchases) matter more when any user can bring an agent.

What changes in the development process

  • Design reviews ask "how will an agent use this?" alongside "how will a person use this?".
  • Contract tests cover API and MCP interfaces as rigorously as UI tests cover screens.
  • Evaluation includes running real agents against staging to see where they get confused.
  • Security testing includes agent-driven abuse and prompt-injection paths through your data.

The bottom line

AI-native applications treat agents as a first-class kind of user: capabilities exposed through clear interfaces, operations that are safe to retry and easy to confirm, permissions that can be delegated narrowly, and accountability for every action. Designing that in from day one is far easier than retrofitting it when agent traffic arrives.

Our secure SDLC and agentic AI security teams design applications and MCP interfaces that work well, and safely, for humans and agents alike.

EthicalHat Research

The EthicalHat research team: penetration testers, SOC analysts and engineers writing about security, software engineering and AI.

Want an expert opinion on your own systems?

Email info@ethicalhat.com or call +1-844-838-4422. Our security engineers are happy to talk it through.