Prompt
I want an AI agent that can use internal APIs and CRMs without exposing everything, what options make sense?
Latest observation
Oct 9, 2026
OpenAI APIWeb search: off
Yes — the key is to give the agent controlled tool access, not raw access to all your systems.
The main options
1) Tool-using agent with scoped API wrappers
Best general-purpose approach.
- You expose only specific backend actions as tools:
search_customercreate_support_ticketupdate_deal_stagefetch_invoice_status
- Each tool enforces:
- authentication/authorization
- field-level filtering
- rate limits
- audit logs
- The agent never sees your full internal API surface.
Pros
- Strong control
- Easy to audit
- Works with CRMs, databases, ticketing, internal services
Cons
- Requires building/maintaining tool wrappers
- You need to design permissions carefully
2) Agent behind a policy/permission layer
Good when multiple teams or workflows need different access.
- The agent asks for a capability, not direct data access.
- A policy engine decides:
- what it can do
- what fields it can read
- whether human approval is needed
- Example: it can draft a refund, but not execute it without approval.
Pros
- Safer for sensitive operations
- Good separation of duties
- Scales across use cases
Cons
- More infrastructure
- More latency/complexity
3) Retrieval-only access + separate action tools
Best when the agent mostly needs context.
- Use RAG / search over approved documents and CRM records.
- Keep write actions separate and tightly controlled.
- Example:
- read customer notes via search
- create case via one dedicated tool
Pros
- Limits exposure
- Good for knowledge-heavy assistants
Cons
- Retrieval quality depends on indexing
- Still need secure write tools
4) Human-in-the-loop for sensitive actions
Best for high-risk workflows.
- Agent can recommend or prepare actions.
- A human approves before anything changes in CRM or internal systems.
- Common for:
- discounts
- account changes
- refunds
- legal/compliance-sensitive updates
Pros
- Very safe
- Easier to adopt in regulated environments
Cons
- Slower
- Not fully autonomous
5) Dedicated agent runtime in your network
Best for stricter security requirements.
- The model runs in a controlled environment:
- VPC / private network
- private API gateway
- secrets manager
- no direct internet egress except approved endpoints
- Tools call internal services directly via private endpoints.
Pros
- Strong isolation
- Easier compliance story
Cons
- More ops overhead
- More setup
What usually makes sense in practice
For most companies, the best pattern is:
LLM + narrow tool layer + policy checks + audit logging
That means:
- the model reasons
- tools are purpose-built and minimal
- access is role-based
- sensitive actions require approval
- all tool calls are logged
Security design principles
To avoid “exposing everything,” do these:
- Least privilege: each tool does one thing
- Field-level filtering: only return necessary columns
- Row-level security: only allowed customers/accounts
- Read/write separation: read tools and write tools are distinct
- Approval gates: for dangerous actions
- Auditability: log every request and tool invocation
- Secrets isolation: model never sees raw credentials
- Prompt injection defenses: tool outputs should be sanitized and constrained
A good architecture example
- User asks: “What’s the status of Acme’s open deal?”
- Agent calls
find_account(name="Acme") - Agent calls
get_deal_summary(account_id=...) - Tool returns only allowed fields
- Agent answers
- If user asks to update stage:
- agent prepares change
- policy layer checks permission
- maybe human approves
- tool executes update
If you want vendor/platform options
You can implement this with:
- OpenAI/Anthropic/etc. + your own tool layer
- Orchestration frameworks like LangChain, LlamaIndex, Semantic Kernel
- Workflow/policy systems like custom approval services, OPA-style policy checks, or internal API gateways
The important part is less the model and more the control plane around it.
Recommendation
If you’re starting from scratch, I’d suggest:
- Build narrow internal tools around CRM/API actions
- Add role-based access and field filtering
- Log every tool call
- Require approval for write actions above a threshold
- Keep the agent in a private environment if data is sensitive
If you want, I can sketch:
- a reference architecture
- a tool permission model
- or a CRM agent design for Salesforce / HubSpot / Zendesk.