How AI Agents Connect To Business Apps

Photo: Daniil Komov / Pexels
An AI agent that "checks your calendar" or "updates a CRM record" is not reasoning its way into your software. It is calling a function definition a developer wrote in advance, formatted as structured JSON, and authorized through the same OAuth tokens a human employee would use if they logged in with a limited-access account. Everything that looks like autonomous judgment sits on top of integration plumbing that predates AI by two decades: REST APIs, webhooks, and permission scopes. This piece walks through that plumbing end to end, including where it breaks in production and what a real integration decision looks like once you're past the demo.
The building block: function calling, not magic
Large language models do not execute code, browse databases, or click buttons. They predict text, one token at a time. The technique that lets a model "use tools" is function calling (also called tool use), where a developer describes the available functions to the model in a structured schema — name, parameters, a natural-language description — and the model outputs a request to invoke one of them, such as create_invoice(customer_id, amount, due_date). OpenAI formalized this pattern for its API in mid-2023, and Anthropic ships an equivalent capability under the name "tool use" in the Claude API. The model itself never touches Salesforce, Slack, or QuickBooks. It emits a structured object; a separate execution layer, written by a developer and running under its own credentials, is what actually calls the target application's API and returns the result as text the model reads back into the conversation.
This means every product marketed as an "AI agent" is really three layers stacked on top of each other, and the distinction matters because each layer fails differently:
- The reasoning layer — the language model itself, deciding what to do next based on the conversation and the results of previous tool calls.
- The schema layer — the JSON definitions that translate the model's intent into a well-formed API call, including which parameters are required and what data types they accept.
- The execution layer — the runtime that actually holds API keys or OAuth tokens, makes the HTTP request against the target application, and enforces whatever permission scope was granted ahead of time.
If the reasoning layer misfires, you get a wrong decision (asking to delete the wrong record). If the schema layer is loosely defined, you get a malformed but plausible-looking request (an end date before a start date). If the execution layer is over-permissioned, a mistake in either of the first two layers has a much bigger blast radius than it should. Debugging a broken agent almost always means figuring out which of these three layers actually failed, because the symptom (the agent "did the wrong thing") looks identical from the outside no matter which layer caused it.
It's worth being precise about vocabulary here, because marketing language blurs it deliberately. An API (application programming interface) — a defined set of rules and endpoints that let one piece of software request data or actions from another, without either side needing to know the other's internal code. A webhook — the inverse of a normal API call: instead of your system asking "did anything happen?", the other application pushes a notification to a URL you control the moment an event occurs, like a new Stripe payment or a new Slack message. Agents that need to react to events in real time, rather than just execute a task on request, typically depend on webhooks rather than polling an API repeatedly.
Authentication is the real gatekeeper, not the model's judgment
Business applications do not hand an AI agent unrestricted access just because a developer wired up an integration. They use OAuth 2.0, the industry-standard authorization framework that also underlies "log in with Google" buttons and the process by which a third-party calendar app can read your Google Calendar without ever seeing your Gmail password. OAuth 2.0 — an authorization protocol that lets an application request a scoped, revocable access token from a service, instead of being handed the user's actual password.
The critical detail is the word "scoped." An agent connecting to HubSpot, for example, typically requests a narrow permission like crm.objects.contacts.read rather than blanket administrative access. A well-configured integration limits what the agent can touch at the API level, independent of what the language model inside the agent decides to ask for. This is the load-bearing safety mechanism in the entire stack: if the model hallucinates a request to modify a contact it was never supposed to touch, a correctly scoped token simply returns a permission-denied error rather than executing the action. The model's judgment is not the security boundary. The token's scope is.
This distinction, model-as-requester versus token-as-gatekeeper, is the single most common thing people misunderstand about agent security. An agent "deciding" to do something and an agent being "able" to do something are two entirely separate questions, answered by two entirely separate systems, and conflating them is how teams end up either overtrusting agents (assuming the model's own restraint is the safety mechanism) or overbuilding guardrails around a system that was never actually capable of the action they're worried about in the first place.
How token scopes actually get requested and granted
When a developer registers an integration with a platform like Google, Microsoft, or Salesforce, they declare which scopes their application needs during setup, and the end user sees a consent screen listing those specific permissions before authorizing the connection. The resulting access token is cryptographically tied to exactly those scopes, generally expires after a set period, and can be revoked by the user or administrator at any time without needing to change a password. This is why a poorly scoped integration is a governance failure, not a technical limitation. The platforms almost always support fine-grained scopes; the failure is usually a developer requesting broader access than the use case needs because it's faster to build against a wider scope during development.
Four ways agents actually connect to apps
Not every integration works the same way, and the choice of pattern has real consequences for latency, reliability, and how much custom engineering a team has to maintain. The table below compares the four patterns you'll encounter in production agent systems.
| Pattern | How it works | Typical latency | Reliability | Setup complexity |
|---|---|---|---|---|
| Direct REST API calls | Agent's execution layer calls the app's documented HTTP endpoints directly, using an API key or OAuth token | Low (100 ms – 1 s per call) | High, if the API has stable versioning | Medium — requires reading and maintaining against each app's API docs |
| Webhooks (event-driven) | The business app pushes a notification to a URL the agent's system listens on, triggering a reaction | Near-instant on the triggering event | High, but depends on the app's webhook uptime and retry behavior | Medium — requires a publicly reachable endpoint and signature verification |
| Native plugins / connectors (Zapier, Make, platform app marketplaces) | A pre-built, no-code connector handles auth and field mapping between two apps | Medium (seconds, due to platform polling/queueing) | Medium — depends entirely on the third-party platform staying maintained | Low — little to no custom code |
| MCP-style tool-use protocols | The agent discovers available tools from a standardized server at runtime instead of hardcoded schemas | Low to medium, adds a discovery round-trip | Emerging — newer standard, fewer years of production hardening | Low once an MCP server exists for the target app; medium to build one from scratch |
| RPA / browser automation | A bot simulates clicks and keystrokes in the app's actual UI, with no API involved | High (seconds per UI interaction) | Low — breaks whenever the UI layout changes | High initially, then high ongoing maintenance |
Direct API calls and webhooks are the most reliable because they're contracts the app vendor explicitly maintains; RPA is the least reliable because it depends on a UI the vendor never promised to keep stable.
Direct REST API integration is the default choice whenever the target application publishes a documented, versioned API, because it's the only pattern where the vendor has made an explicit compatibility promise. Webhooks complement this for anything event-driven, a new support ticket, a form submission, a payment, since polling an API repeatedly for changes wastes calls and adds latency compared to a push notification.
No-code connector platforms like Zapier and Make trade reliability and speed for accessibility. They exist specifically so a non-developer can wire two apps together without writing integration code, and for low-volume, non-critical workflows that tradeoff is entirely reasonable. What they cannot offer is the fine-grained control a custom integration gets over retry logic, error handling, or exactly which fields get validated before a write happens, because you're working within whatever the connector platform's own abstraction allows.
RPA (robotic process automation), where a bot literally simulates mouse clicks and keyboard input inside an application's user interface, is the pattern teams reach for only when no API exists at all, typically with legacy enterprise software that was never built with integration in mind. It's the least reliable pattern by a wide margin, because it depends on a UI layout the vendor never promised to keep stable, and a routine software update on the target application's side can silently break the automation with no warning and no error message pointing at the real cause.
A concrete example: the calendar-booking agent, layer by layer
Consider an agent built to schedule meetings by reading a user's calendar and a lead's email thread. The function schema exposes something like check_availability(date_range) and create_event(title, attendees, start_time, end_time), each backed by a Google Calendar API scope such as calendar.events. Walking through what actually happens on a single request makes the three-layer model concrete rather than abstract.
First, the reasoning layer receives the instruction "find 30 minutes with Sarah next week" and, based on the tool schemas it's been given, decides to call check_availability with a date range parameter. Second, the schema layer validates that the model's output actually matches the expected shape, correct parameter names, correct data types, a well-formed date range, before anything is sent onward. Third, the execution layer takes that validated request, attaches the stored OAuth token, makes the authenticated HTTPS call to Google's Calendar API, and receives back a JSON response listing open slots. That response gets fed back to the model as text, and the model decides its next move, likely calling create_event with a specific proposed time.
This layered design is also why agent reliability is fundamentally an engineering problem wearing an AI costume. If the developer's schema for create_event doesn't validate that end_time comes strictly after start_time, the model can emit a technically well-formed but logically broken request, and the calendar API will either reject it outright or, in a worse case, silently create a malformed zero-duration or backwards event. Anthropic's own published guidance on tool use recommends strict schema validation paired with clear, specific error messages returned to the model, precisely because a model that receives a vague failure response ("something went wrong") tends to retry with equally malformed parameters rather than correcting the underlying issue, while a model that receives a specific error ("end_time must be after start_time") can usually self-correct on the next attempt.
Why the model can't just "figure out" the API on its own
A model has no live connection to Google's servers, no memory of the Calendar API's actual current behavior, and no way to inspect real response codes unless a developer's execution layer explicitly returns that information as text. Every capability the agent appears to have was deliberately exposed through a schema someone wrote. If a function isn't defined and described in the schema, the model cannot invoke it, no matter how clearly the user asks.
Where this breaks in production
The most common failure mode is not malicious action, it's scope creep in interpretation: a model asked to "clean up my inbox" interprets that instruction more aggressively than intended and archives emails a human would have wanted to keep. Because the model generates the specific parameters for each function call from natural language, ambiguous or under-specified instructions produce unpredictable parameter values, and there is no built-in mechanism forcing the model to pause and confirm unless a developer explicitly built that checkpoint into the execution layer.
A second common failure is context loss across multi-step chains. Agents that chain several tool calls together, read a spreadsheet, then update a CRM record, then send a Slack notification, can lose track of state between steps, particularly when the output of one call needs to feed accurately into the input of the next and the intermediate reasoning drifts. Both Anthropic and OpenAI have published guidance recommending human-in-the-loop confirmation for any action that's destructive or hard to reverse, deleting records, sending external communications, issuing refunds, precisely because these multi-step chains compound small errors rather than catching them.
A third, less discussed failure is rate limiting and API quota exhaustion. Business applications throttle how many requests a given API key or token can make in a given window, and an agent looping through a retry cycle after a failed call, or fanning out many parallel tool calls in a batch task, can hit that ceiling far faster than a human user ever would. When that happens, the agent typically receives an HTTP 429 (too many requests) response, and unless the execution layer has explicit backoff-and-retry logic, the agent either stalls or, worse, the model tries to interpret the rate-limit error as if it were a normal application response and generates a plausible-sounding but incorrect next step.
A fourth failure worth naming explicitly: version drift. APIs change. A vendor deprecates a field, renames a parameter, or ships a new API version with a different response shape, and an integration built against the old contract starts failing, sometimes silently, if the schema layer doesn't validate the response shape as rigorously as it validates the outgoing request. Production agent systems that have been running for more than a few months accumulate this kind of drift risk the same way any long-lived software integration does; it has nothing specific to do with AI.
The economic tradeoff underneath all of this mirrors traditional software integration work generally: tighter permission scopes and more validation logic produce safer agents but slower development, while broad scopes and minimal validation ship faster but concentrate risk in a system that can act with less oversight than a human employee performing the same task. Teams building production agents increasingly treat this as a deliberate design decision made up front, budgeting real engineering time for the permission and validation layer, rather than assuming the model's own apparent judgment will compensate for a loosely built integration. It won't, because the model has no visibility into consequences it can't observe through the text it's given back.
Function calling versus MCP: two different abstraction levels
It's worth being explicit about how function calling (OpenAI's and Anthropic's native tool-use APIs) relates to the Model Context Protocol, because they're often described interchangeably and they solve different problems. Function calling is the mechanism by which a model, within a single conversation, decides to invoke a tool from a list the developer provided for that specific request. It's a capability of the model API itself. MCP, by contrast, is a protocol for how a client application discovers and connects to external tool servers in a standardized way, so that a company building an agent doesn't need to write custom integration code for every single business app it wants the agent to reach.
Put concretely: function calling is how the model says "I want to call the create_invoice tool." MCP is a standardized way for the application hosting that model to discover, at runtime, that a create_invoice tool even exists on some connected server, what parameters it needs, and how to reach it, without a developer having hardcoded that specific integration in advance. Before MCP, connecting an agent to ten different business apps meant writing and maintaining ten separate custom integrations. An MCP server for a given app, once built (by the app vendor, a third party, or the integrating company itself), can in principle be reused by any MCP-compatible client, the same way a USB-C port works across many devices instead of every peripheral needing its own proprietary connector. That analogy has limits, since MCP servers still need to be built, hosted, and kept in sync with the underlying app's API, but it captures the core shift: from bespoke point-to-point wiring toward a shared discovery layer.
What this means for anyone evaluating an "AI agent" product
When a vendor demos an agent that "connects to your whole stack," the honest question to ask is which of the four integration patterns above they're actually using for each connected app, because the answer determines how the product will behave under real load, not just in a clean demo environment. A vendor relying heavily on browser-based RPA for critical connections is signing up for ongoing breakage every time a target app updates its UI. A vendor using direct API integration with properly scoped OAuth tokens has made a more durable, if more expensive to build, choice.
It's also worth asking what happens when a tool call fails, since that's where the difference between a well-engineered agent and a fragile one actually shows up. Does the system retry with backoff, surface a clear error back to the model so it can self-correct, or escalate to a human? Vendors who can answer that question specifically, rather than with "the AI handles it," are generally the ones who've actually built the execution layer with production failure modes in mind rather than just the happy path a sales demo walks through.
The takeaway
Agent-to-app connections work because of unglamorous infrastructure that existed long before generative AI: typed function schemas, OAuth 2.0 scopes, REST APIs, webhooks, and execution runtimes with their own credentials and permission boundaries. The language model decides what to call and generates the parameters for the request; it never removes the need for the same access controls and validation logic that kept human-built software integrations safe. Reliability in agent systems comes from treating the schema and execution layers with the same engineering rigor as any other production API integration, not from trusting the model's own judgment as the safety mechanism. Read the specific agent-provider documentation for which actions require human confirmation before granting any integration broad access.
Read next:
- Why AI hallucinates facts
- What AI agents can and cannot do
- How AI models learn from feedback
- Why AI search tools cite sources differently
FAQ
Q: Do AI agents actually understand the apps they connect to?
No. The model reads a text description of each available function and predicts which one fits the request, based on patterns learned during training. It has no direct awareness of the app's interface, database, or actual current state; the JSON schema a developer wrote is the entire extent of its "understanding."
Q: Can an AI agent access data outside its granted permissions?
Not if the integration is scoped correctly at the token level. OAuth 2.0 scopes and API keys enforce boundaries at the application layer, independent of what the model itself tries to request, though a misconfigured integration with overly broad scopes removes that safety net entirely.
Q: What is the Model Context Protocol and how is it different from function calling?
MCP is an open specification from Anthropic, released in November 2024, that standardizes how AI applications discover and call external tools and data sources at runtime. Function calling is the underlying model capability to invoke a tool within a conversation; MCP standardizes how that tool becomes discoverable in the first place, reducing the need for custom point-to-point integration code per app.
Q: Why do agents sometimes take the wrong action even when correctly connected?
Because the model generates call parameters from natural-language instructions, ambiguous or under-specified requests can produce a technically valid but unintended function call. This is why reversible-action safeguards and human-in-the-loop confirmation for destructive actions matter more than restricting the model's stated permissions alone.
Q: What's the difference between a webhook and a regular API call in an agent integration?
A regular API call is the agent's system actively requesting information or triggering an action from the app. A webhook is the reverse: the business app pushes a notification to the agent's system the moment an event happens, letting the agent react in near real time instead of repeatedly polling for changes.
Q: Is RPA (robotic process automation) still used for AI agent integrations?
Yes, but typically only as a fallback for legacy or enterprise software that has no documented API. It's the least reliable integration pattern because it depends on simulating clicks against a user interface that can change without warning, breaking the automation with no clear error pointing at the real cause.
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

Best AI Manga and Anime Clip Makers for Non-Artists (2026)
Best AI manga and anime clip makers for non-artists (2026): Gootaku, Anifusion, NovelAI, Dashtoon, Pixton, and Storyboard That, judged on free access and range.

Function Calling vs Tool Use in LLMs Explained
Function calling and tool use are the same concept under different names. Learn how LLMs invoke external tools, with examples from OpenAI, Anthropic, and Google.

What Is Agentic AI? Workflows, Tools, and Real Limits
Agentic AI is the next buzzword, but the useful concept is simple: models that plan, call tools, check results, and repeat toward a goal.

What Is Cline? VS Code AI Coding Agent
Cline is a free, open-source VS Code extension that turns the editor into an autonomous AI coding agent. How it works, pricing, and when to use it.

Claude Skills Explained — Anthropic's New Feature
Claude Skills are folder-based modules that extend Claude with scripts, instructions, and resources. Here's how they work and differ from MCP.