Secure Data Access for AI Agents and Tools
A practical guide to emerging data architecture and AI-ready information.
An agent that can query, write or trigger systems acts through permissions. Define its identity, user context, purpose, allowed data, operations and execution boundary. Avoid broad shared credentials or access that exceeds the user's authorized scope.
Treat tool access as delegated authority
An agent that can query, write or trigger systems acts through permissions. Define its identity, user context, purpose, allowed data, operations and execution boundary. Avoid broad shared credentials or access that exceeds the user's authorized scope.
Separate reading from action
Grant read access independently from write or administrative actions. Require explicit approval for consequential changes, external sharing or destructive operations where risk warrants it. Use validation and policy checks outside the model's natural-language instructions.
Protect retrieved data and secrets
Filter records by user and task authorization before including them in context. Minimize sensitive data, redact secrets from prompts and logs, and treat retrieved content as untrusted input. Define safe handling for prompt injection and malicious documents.
Audit and manage lifecycle
Log identity, request purpose, data sources, tool calls, approvals, outcomes and errors in a privacy-aware way. Set retention and review controls. Monitor unusual access and provide a rapid revocation path. NIST's AI RMF and GenAI Profile can inform risk review; see NIST AI Risk Management Framework and NIST Generative AI Profile.
Validate and govern
Test with representative inputs, document assumptions and limitations, and assign owners for quality, access, provenance and change. Reassess controls when sources, models, users or intended decisions change.
Bind access to an attributable principal
Model whether a tool call acts as a user, service or delegated agent identity. Record the principal, scope, purpose, resource and action. Avoid broad shared credentials that make it impossible to attribute access or revoke a single workflow.
Enforce controls at each resource
Check authorization at the data or tool boundary, even if the agent orchestrator already applied a policy. Restrict queries, actions, row or field scope and export capability. Test indirect paths such as cached results, search indexes, generated files and retrieved context.
Protect secrets and logs
Keep credentials outside prompts and outputs, rotate or revoke them through the approved process, and prevent tools from returning secrets unnecessarily. Logs should support investigation without capturing entire sensitive payloads by default. Define access and retention for prompts, tool inputs, outputs and audit events.
Test denial, revocation and misuse cases
Test unauthorized resource access, expired permissions, prompt attempts to broaden scope, tool failures and user changes during a session. Verify that access is denied and recorded, and that the agent does not retry through a more privileged path. Assign incident and policy owners.
- Is every action attributable to a principal?
- Are permissions enforced at the resource boundary?
- Can access be revoked promptly?
- Are secrets excluded from prompts and logs?
- Are denied attempts and escalation paths tested?
Worked example: retrieval and tool access
A user asks an agent to summarize records and create a follow-up task. Apply the user's authorized scope to retrieval, then separately authorize the write action. Pass only the necessary fields to the model and tool. Do not let retrieved text grant permissions or override policy. Validate resource identifiers and action parameters at the service boundary.
Use short-lived, scoped credentials and distinguish human identity from service execution. Log authorization decisions, resource references, and outcomes while protecting sensitive prompt data. Define how access revocation propagates to caches and derived indexes. If the agent cannot establish authorization or data freshness, it should fail safely or request human review.
Test access boundaries
Test cross-tenant queries, indirect prompt instructions, replay, expired tokens, bulk export, and denied writes. Confirm that audit evidence can link the request to its delegated authority. Review logs for oversharing and establish retention. Security depends on enforceable access controls around tools and data, not on an instruction in a prompt.
Review agent access and revocation
Inventory tools, scopes, service identities, data sources, and delegated roles. Remove unused capabilities and set expiry for temporary grants. Test revocation across active sessions, queues, caches, indexes, and downstream services. Keep audit records that connect a tool action to delegated authority and result.
Review permissions when the agent workflow or tool changes. Test that untrusted retrieved content cannot grant new authority. Escalate ambiguous or high-impact actions to an authorized person and document the approval path.
Review agent access evidence
Sample tool calls and confirm delegated identity, scope, policy result, data accessed, and outcome are recorded at the required level. Verify logs are protected and retained according to approved policy. Check that sensitive prompts are minimized or redacted.
Review access grants after workflow changes and remove unused tools. Test emergency revocation and incident response. Keep a clear owner for access policy and tool enforcement.