AI Agents in Business: Implementation, Integrations, and Security
How to implement AI agents in business: CRM and ERP integration, architecture, permissions, human oversight, testing, and evaluating costs and benefits.
Imagine a company receiving dozens of customer inquiries every day. Employees read incoming messages, look up customer records in the CRM, check orders in the ERP system, and prepare responses. Each request is slightly different, even though most involve a similar set of tasks.
Some of this work can be automated using conventional software. Things become more complicated when the next step depends on the content of a message, the context of a conversation, or information buried in documents.
This is where AI agents can help. They can interpret requests, use external tools, and interact with existing business systems.
Connecting a language model to company applications, however, is not enough to build a reliable solution. The underlying architecture must control access to data, enforce business rules, and make failures detectable.
How should such a system be designed? When does using an AI agent make sense, and what should be considered before allowing it to perform real business operations?
What Is an AI Agent, and How Is It Different from a Chatbot?
An AI agent is a system that uses artificial intelligence to carry out tasks involving multiple steps.
Unlike software that follows a strictly predefined sequence, an agent can interpret the current context, choose from available tools, and decide what to do next based on the results of previous actions.
Consider three approaches to handling customer inquiries.
A traditional chatbot answers questions about products, company policies, or ordering procedures. Its role typically ends with generating a response.
Conventional automation follows a predefined workflow. When a customer submits a form, the system creates a CRM record, assigns it to the appropriate queue, and sends a confirmation.
An AI agent can analyze a message, identify the customer’s intent, retrieve an order from an ERP system, check its status, and draft a response using current information.
The distinction is not simply whether artificial intelligence is involved. Language models can also be embedded in conventional automation workflows.
What matters is the system’s degree of autonomy: whether the model only processes information or also selects subsequent actions and invokes available operations.
The boundaries between chatbots, workflows, and agents are not always clear. When designing a solution, defining what the system is allowed to do is more useful than debating which label best describes it.
Where Can AI Agents Help Businesses?
AI agents are particularly useful in processes where employees must interpret information, consult multiple data sources, and adjust their actions to individual circumstances.
Sales inquiries are a good example. Customers describe their needs in their own words, often leaving out important details. An employee must understand the request, check existing information, and determine what else is needed before preparing a response.
Similar opportunities exist across other business functions.
Customer Support and Ticket Handling
An agent can categorize incoming requests, identify recurring issues, retrieve customer interaction histories, and draft responses.
A more advanced implementation can also check order statuses or route tickets to the appropriate department.
Document Processing
Businesses work with invoices, contracts, forms, and correspondence that do not always follow a consistent structure.
An agent can extract relevant information, compare it against records in other systems, and flag discrepancies for review.
That does not mean the model should independently approve financial documents or make decisions with legal consequences.
Internal Business Operations
An agent can help employees find information, interpret internal procedures, or prepare reports.
Instead of manually navigating several applications, users can ask a question and have the system retrieve the necessary information from authorized sources.
The resulting response should make its sources identifiable, particularly when the information will inform business decisions.
Engineering and IT Operations
AI agents can analyze support tickets, search technical documentation, correlate monitoring data, and assist with troubleshooting.
Their role does not have to be limited to code generation. They can also support incident investigations and repetitive operational tasks, provided their permissions and available actions are appropriately restricted.
What these examples have in common is the need to work with information that cannot easily be handled through a small set of fixed rules.
When Is an AI Agent the Wrong Choice?
The growing popularity of AI agents has led to their use being proposed even where conventional software would be a better fit.
Suppose a company wants to automatically retrieve orders from an online store and transfer them into an ERP system. The data structure is known, and processing follows clearly defined rules.
A well-designed API integration is sufficient for this task.
Introducing a language model would add components, increase maintenance costs, and introduce additional failure modes without delivering a proportional benefit.
The same applies to processes requiring deterministic behavior. Calculating taxes according to defined rules or updating inventory records should rely on explicit business logic.
An AI agent may also be unsuitable when:
- The company lacks reliable data required to perform the task.
- There is no practical way to evaluate the correctness of its output.
- The cost of handling errors outweighs the expected savings.
- The process involves actions whose consequences cannot be safely limited or reversed.
In practice, a hybrid approach often works best. A language model interprets messages or documents, while conventional software handles operations that require strict control.
Practical Example: An AI Agent Integrated with CRM and ERP
Consider a hypothetical distribution company serving business customers.
The company uses a CRM platform to manage customer relationships and an ERP system to handle orders, inventory, and sales documentation.
One morning, the sales team receives the following message:
Hello, we’d like to reorder the same products we purchased last month. Are they all available, and when could we expect delivery?
The message contains no product codes or previous order number. A sales representative would normally need to identify the customer, locate the earlier order, and check product availability.
An AI agent could handle the initial investigation and prepare a response.
How Would the Workflow Operate?
1. Read and interpret the message
The agent identifies the customer’s intention to repeat a previous order and request an estimated delivery date.
2. Identify the customer
The system uses sender information and CRM records to find the relevant customer. If multiple records match, the task is flagged for further verification rather than allowing the agent to make an arbitrary choice.
3. Retrieve order history
The agent invokes a tool that retrieves the customer’s previous orders from the ERP system through an API.
4. Check availability
The system identifies which products are in stock and whether reliable delivery estimates are available.
5. Draft a response
The agent prepares an email containing product availability, delivery information, and any questions that still need clarification.
6. Obtain approval from a sales representative
An employee reviews the draft and decides whether it is ready to send.
In this scenario, the agent cannot change prices, place an order, or promise a delivery date that has not been confirmed by the logistics system.
These restrictions are not imposed because the technology is incapable of performing those actions. They reflect deliberate decisions about responsibility for business operations.
How Could the Solution Evolve?
After the initial implementation has been tested, the company could extend the automation to drafting quotations, updating CRM records, or independently answering straightforward inquiries.
Each new capability requires its own risk assessment.
Automatically providing an order status is very different from approving a discount, changing contract terms, or creating a new order.
The agent’s autonomy should increase gradually, based on testing results and observed behavior in production.
How Should an AI Agent’s Architecture Be Designed?
A prototype that connects a language model to a handful of functions can be built relatively quickly. A production system, however, must handle integration failures, incorrect model outputs, access restrictions, and tasks that take longer than a single HTTP request.
An agent should therefore operate within a broader application architecture with clearly defined responsibilities.
Language Models and Orchestration
The language model interprets tasks and selects actions from the capabilities made available to it.
The orchestration layer manages the execution flow. It maintains task state, exposes tools, processes tool responses, and determines when a task should finish or move to another stage.
In a simple application, orchestration may involve only a few functions. More complex workflows require state management, execution limits, retry policies, and the ability to resume interrupted tasks.
Not every application needs a dedicated agent framework. When a workflow is short and predictable, a straightforward implementation may be easier to maintain.
Backend Services and API Integrations
A language model should not have unrestricted administrative access to company databases.
A safer approach is to expose a limited set of operations through a controlled integration layer.
For example, a backend built with Python and FastAPI could provide the following tools:
find_customer— locate a customer record.get_customer_orders— retrieve order history.check_product_availability— check inventory availability.create_offer_draft— create a draft quotation.
Each tool has defined arguments, an input schema, and a set of possible outcomes.
The model selects an operation, but the application validates its parameters, verifies the user’s identity, and checks whether access to the requested resource is permitted.
Business rules remain in the backend. It determines whether a customer is authorized to view a particular order, whether a price is current, and whether an operation is allowed.
This prevents the language model from becoming the source of truth for the system’s business state.
RAG and Access to Documentation
Some agents need information from manuals, company policies, or internal documentation.
Retrieval-Augmented Generation (RAG) is commonly used in these situations. The system retrieves relevant passages and supplies them to the model as additional context.
RAG is useful for working with documentation, but it is not a replacement for accessing current transactional data.
If an agent needs the latest inventory figures, it should retrieve them from the system responsible for inventory management rather than relying on a document that may be outdated.
Using RAG does not guarantee accurate answers. Retrieval quality, document freshness, access controls, and the way retrieved information is used all affect the result.
Asynchronous Processing and Apache Kafka
Some tasks finish within seconds. Others require analyzing multiple documents or waiting for responses from external systems.
For longer-running operations, processing everything within a single HTTP request becomes impractical and increases the risk of timeouts.
Asynchronous processing with a task queue or message broker is often a better approach. The application queues a task, and a separate worker executes it independently of the user’s connection.
For more complex architectures, Apache Kafka may be appropriate.
Kafka is particularly useful when systems exchange large volumes of events, multiple consumers need to react to the same information, or event streams must be retained and replayed.
It should not, however, be the default choice for running agent tasks. A simpler task queue may provide everything a smaller application needs with significantly less operational overhead.
API and MCP: How Do Agents Communicate with Business Systems?
Model Context Protocol (MCP) is an open standard that allows AI applications to access tools and resources exposed by external systems.
An MCP server can expose operations for searching information, retrieving documents, or invoking business functions.
This does not mean MCP replaces traditional APIs.
Consider an existing order management system that provides a REST API. An MCP server can be built on top of it, exposing selected operations in a standardized format supported by MCP-compatible AI applications.
Different AI applications can then reuse the same tools without requiring a separate custom integration for each client.
MCP defines how tools are exposed and invoked, but adopting the protocol does not automatically solve business authorization or data security problems.
The server must still verify whether a user is allowed to access a particular record or execute a requested operation.
When does MCP make sense?
When an organization wants to share a common set of tools across multiple AI applications or standardize how those applications interact with external systems.
When are direct API calls sufficient?
When a project involves a single agent, a small number of operations, and no particular need for an additional interoperability layer.
Adding MCP simply because it is gaining popularity can introduce unnecessary complexity.
AI Agent Security
An agent that only reads public documentation presents a different level of risk from one that can modify customer records or initiate financial transactions.
The greatest concerns arise when a language model has access to sensitive information and can independently trigger actions in external systems.
Limiting Permissions
An agent should have access only to the resources and operations required for its specific task.
An agent preparing quotations might need read access to the product catalog and order history. It has no reason to delete customer accounts or modify price lists.
These restrictions must be enforced by the application and its authorization mechanisms.
Even a carefully written instruction telling a language model not to perform certain actions is no substitute for access control.
When an agent acts on behalf of a user, the system must also respect that user’s actual permissions. Having the technical ability to call an API does not mean every user should be allowed to invoke the underlying operation.
Prompt Injection
One of the distinctive security threats in agentic systems is prompt injection: an attempt to influence a model’s behavior through specially crafted content.
The attacker does not need to interact with the agent directly.
Malicious instructions may be embedded in emails, documents, web pages, or tool responses.
Suppose an agent is analyzing an attachment submitted with a request for quotation. The document contains an instruction telling the agent to send the customer database to an external address.
The attachment must remain material to be analyzed. It must not become a trusted source of instructions or permissions.
Defending against these attacks requires multiple independent controls: separating trusted instructions from external data, validating tool arguments, enforcing authorization, and limiting the operations available to the model.
No single prompt can provide complete protection against prompt injection.
Idempotency and Retrying Operations
Not every risk comes from a deliberate attack. An agent can also cause unintended consequences when ordinary communication failures occur.
For example, a system submits a request to create an order but does not receive a response. Unable to determine whether the operation succeeded, it retries the request.
Without appropriate safeguards, the system may create two identical orders.
Common solutions include idempotent operations, idempotency keys, and duplicate detection mechanisms.
It is also important to distinguish operations that can be safely retried from those that require checking the outcome of the previous attempt.
These are familiar challenges in distributed systems. They become particularly important in agent architectures because subsequent calls may be initiated by a language model.
Auditing Agent Actions
A production system should make it possible to determine which tool was called, what parameters were supplied, whether authorization succeeded, and what the operation returned.
One particularly important distinction is the difference between an action proposed by the model and an operation actually executed by the backend.
Audit logs must also comply with data protection requirements. Recording entire messages and tool responses without restrictions could itself expose confidential information.
Human-in-the-Loop: When Should People Approve Agent Actions?
Human-in-the-loop refers to involving a person at selected stages of an automated process, usually when a decision carries greater risk.
It does not mean requiring approval every time an agent reads data or searches a document.
An agent handling sales inquiries might independently draft a response, while sending the message or changing the terms of an offer requires employee approval.
A well-designed approval interface shows the user exactly what operation will be performed, which data it affects, and what the expected consequences are.
Approval should apply to a specific operation, not grant the agent unrestricted permission to take further actions.
Exceptional cases also need to be addressed. What happens if an employee does not respond? Does the task expire? Can it be resumed? What if the underlying data changes between preparing and approving an operation?
These situations must be handled in application logic.
Human oversight reduces risk, but it does not guarantee correctness. If the reviewer receives incomplete information or routinely approves every suggestion without checking it, the control becomes little more than a formality.
AI Agents, GDPR, and the EU AI Act
Deploying AI agents in business requires considering not only the technology itself but also the types of data being processed and the consequences of the system’s actions.
GDPR: What Happens to the Data?
If an agent processes information about customers, employees, or business contacts who are identifiable individuals, that processing may fall within the scope of the General Data Protection Regulation (GDPR).
Before deployment, an organization should establish:
- What personal data does the agent actually need?
- What is the lawful basis for processing that data?
- Is information sent to an external AI model provider?
- How long are the data and diagnostic records retained?
- Who can access them?
- Are personal data transferred outside the European Economic Area?
The division of responsibilities between data controllers and processors also matters, as do appropriate agreements with service providers.
Organizations should not assume that all external language model services handle data in the same way. Retention periods, use of customer data for model training, and processing locations depend on the provider, service terms, and configuration.
Where processing is likely to result in a high risk to individuals’ rights and freedoms, a Data Protection Impact Assessment (DPIA) may be required.
EU AI Act: What Obligations Apply to AI Agents?
The EU AI Act regulates the use of artificial intelligence, with requirements depending on factors such as a system’s intended purpose, risk classification, and whether an organization provides or deploys the solution.
There is no single legal category covering every system described as an AI agent.
An agent that helps employees search internal documentation, for instance, requires a different assessment from an AI system used in recruitment decisions.
Most of the AI Act’s provisions became applicable on 2 August 2026. These include certain transparency obligations, such as informing individuals when they are interacting with an AI system, subject to the conditions and exceptions set out in the legislation.
Following amendments introduced in 2026, the application dates for certain high-risk AI requirements were postponed:
- 2 December 2027 — for high-risk AI systems covered by Annex III, including certain employment-related applications.
- 2 August 2028 — for high-risk AI systems associated with products covered by the relevant sector-specific legislation and Annex I.
These extensions do not postpone every other obligation under the AI Act.
Assessing a particular solution requires considering its intended purpose, degree of autonomy, potential impact on people, and the legislation currently in force.
GDPR and the AI Act also address different regulatory concerns and may apply to the same system simultaneously.
How Much Does It Cost to Implement an AI Agent?
Implementation costs depend primarily on the scope of the business process, the quality of existing systems, and the required level of reliability.
An agent that analyzes documents and produces summaries is considerably simpler than one integrated with multiple systems, complex permissions, and approval workflows.
The total cost extends well beyond model API charges.
It includes process analysis, integration development, backend implementation, infrastructure, testing, monitoring, and ongoing maintenance.
In legacy environments, the biggest challenge may be the absence of suitable APIs or inconsistent data across applications.
How Can You Calculate the Real Cost of a Process?
Suppose a company wants to automate the handling of sales inquiries.
The first step is to measure how long employees spend handling each request and identify the activities involved.
After launching a pilot, the company can compare:
- The time required to handle an inquiry before and after implementation.
- The percentage of requests completed correctly without additional manual work.
- The number of errors requiring intervention.
- Model, infrastructure, and integration costs.
- The effort required to supervise the system.
What matters is the total cost of completing the business process, not merely token consumption.
If an agent drafts a response in seconds but an employee must spend several minutes correcting mistakes, the actual savings may fall well short of expectations.
That is why profitability should be evaluated through a pilot involving real-world cases rather than relying solely on a polished demonstration.
Testing and Monitoring AI Agents
Traditional software can often be tested by comparing its output against a precisely defined expected result.
AI agents are more challenging.
Two successful executions of the same task may not follow identical paths. The model might select tools in a different order or phrase its response differently.
Testing must therefore evaluate both the final outcome and the actions taken along the way.
Evaluating Agent Quality
A representative set of test scenarios should cover common tasks, invalid data, and unusual cases.
For an agent connected to CRM and ERP systems, tests might verify whether it identifies customers correctly, retrieves the right orders, matches the correct products, and avoids using information that the current user is not authorized to access.
Separate tests should cover prompt injection attempts, integration failures, execution limits, and responses containing incomplete or conflicting information.
The quality of the final response should also be assessed separately from the correctness of tool execution.
An agent might produce a convincing email while having retrieved information about the wrong customer.
Such a system should not pass testing merely because its final response sounds plausible.
Monitoring in Production
Once deployed, the system needs observability across the entire task execution lifecycle.
Correlation IDs, application logs, metrics, and distributed traces make it possible to follow model calls and interactions with external services.
Monitoring should cover task duration, tool failures, retry counts, escalation rates, and processing costs.
Changes in response quality also need to be tracked. A model update, documentation change, or API modification can affect agent behavior even when the application code itself has not changed.
Production systems therefore need more than infrastructure monitoring. They also require regular evaluation of how the agent behaves.
Moving from Prototype to Production
Attempting to automate every business process at once makes outcomes harder to assess and increases the risk of expensive changes.
A better starting point is a single, clearly defined use case.
1. Analyze the Process
First, determine what the agent should accomplish, which data it needs, and which activities genuinely require interpretation by a language model.
This analysis may reveal that a simpler integration or conventional workflow can solve the problem without AI.
2. Build a Prototype with Limited Permissions
The initial version should use representative data and demonstrate whether the model correctly understands the tasks.
A sensible starting point is to restrict the agent to read-only operations and generating proposed actions without executing them automatically.
This makes it possible to evaluate output quality without exposing business systems to uncontrolled changes.
3. Develop Integrations and Security Controls
Once the approach proves useful, the backend can be extended with authorization, state management, error handling, and appropriate audit mechanisms.
At this stage, the boundaries of the model’s responsibilities and the conditions under which operations may be executed should be clearly defined.
4. Run a Pilot and Evaluate Results
The system is introduced to a limited group of users or assigned a specific portion of the workflow.
Pilot results provide evidence about actual quality, operating costs, and how often human intervention is required.
These findings help determine whether expanding the automation is economically and operationally justified.
5. Maintain and Improve the System
Production deployment is not the end of the project.
Models, APIs, documentation, and business processes continue to evolve. Any of these changes can affect agent behavior.
Regular regression testing, monitoring, and controlled rollout of new capabilities remain necessary throughout the system’s lifecycle.
Reliable AI Agents Depend on Well-Engineered Software
The real value of AI agents lies in their ability to automate tasks that require interpreting information and working across different systems.
That does not mean a language model should take responsibility for an application’s entire business logic.
Reliability also depends on integration quality, permission management, fault tolerance, and the ability to inspect and verify executed operations.
In practice, a successful implementation begins with a clear understanding of the business process. Choosing the model, tools, and architecture comes afterward.
If you are considering AI agents for your business or software project, Vistware can help with technical analysis, integration design, and building the software needed to put AI to work in a controlled and reliable way.
References and Further Reading
The following resources cover technical architecture, security recommendations, and official European regulatory guidance.
Architecture and Integrations
- Model Context Protocol — Understanding MCP Servers — tools, resources, and communication between AI applications and external systems.
- Model Context Protocol — Tools Specification — tool definitions, invocation, and security considerations.
- Model Context Protocol — Authorization — authorization mechanisms in MCP.
Security
- OWASP — LLM01:2025 Prompt Injection — threats involving attempts to manipulate language model behavior.
- OWASP — LLM06:2025 Excessive Agency — risks associated with excessive agent permissions and autonomy.
GDPR and the EU AI Act
- European Commission — Application of the GDPR — GDPR requirements and responsibilities for personal data processing.
- European Data Protection Board — Opinion 28/2024 on AI Models — selected data protection considerations relating to AI models.
- European Commission — AI Act Implementation Timeline — current application dates for different AI Act provisions.
- EUR-Lex — Regulation (EU) 2026/1744 — amendments to the implementation timeline and selected obligations under the AI Act.