Tool access scope fails when an agent can read data it should not have access to, when access controls are inherited incorrectly across hierarchy levels, when sensitive fields are exposed in tool responses, or when data classification rules are not enforced. The 16 access-scope patterns documented here cover the full data-access pipeline — from field-level and record-level access control through workspace and geographic isolation, to PII exposure in responses and scope-downgrade failures. Access control is particularly fragile in agents because agents can call tools that return data fields the agent should not see, and without explicit masking or field-level filtering, those fields leak into agent reasoning and may be included in responses to users.
Key Takeaways
- 16 patterns are documented here, spanning field-level access control, record-level ownership validation, workspace isolation, PII exposure, and scope-boundary violations.
- PII Field Exposure and Data Scope Boundary Violation are the most severe in multi-tenant or compliance-regulated systems: PII leaking from tool responses is visible to agents that shouldn’t see it, and a workspace-isolation bypass exposes one customer’s data to another customer’s agent.
- Record Ownership Not Validated and Field Level Access Not Restricted are second-order failures specific to tools: a tool returns a record without checking whether the caller has access to it, or returns all fields without filtering unauthorized ones.
- Masked Field Unmasking and PII Field Leakage in Responses are architectural failures: masking is applied at the tool level but agent reasoning unmasks it, or masking is applied to API responses but not to internal cache or logs where agents access it.
Scope
- Field-Level Access Control — Sensitive Field Access Not Restricted, Field Level Access Not Restricted, Masked Field Unmasking. Tools return entire records without filtering sensitive fields; agents see PII, financial data, or other restricted fields they shouldn’t access.
- Record and Object-Level Access — Record Level Access Not Enforced, Record Ownership Not Validated, Account Level Data Scope. Tools return records without checking whether the caller owns or has permission to access that record.
- Tenant and Workspace Isolation — Workspace Isolation Bypass, Data Scope Boundary Violation. An agent from one workspace or tenant accesses data from another workspace; isolation boundaries are bypassed.
- Data Classification and Metadata — Data Classification Access Not Enforced, PII Field Exposure, PII Field Leakage in Responses. Tools don’t enforce access rules based on data classification; PII marked as sensitive is still returned to agents without access.
- Temporal and Geographic Scope — Time Based Data Access Not Enforced, Geographic Data Access Restriction. Access rules based on time (e.g., archived data older than 90 days) or geography (e.g., EU data only to EU agents) are not enforced.
- Cost Disclosure and Inheritance — Computed Field Cost Not Disclosed, Access Control Inheritance Wrong. Accessing a field requires a computation with hidden costs, or inheritance rules cause child records to inherit parent access rules incorrectly.
- Scope Downgrade — Scope Downgrade Not Enforced. An agent’s access scope should reduce (or “downgrade”) when delegating to a sub-agent, but access scope is not reduced, causing scope creep.
- An agent operates in multi-tenant or multi-workspace environments where data from different tenants must be strictly isolated.
- Tools return records with many fields, and some fields are sensitive (PII, financial, health data) that agents should not see or shouldn’t include in responses.
- Compliance or regulatory requirements mandate data access control (GDPR, HIPAA, SOC 2), where access scope violations are auditable incidents.
Cross-Pattern Insight
The 16 access-scope patterns describe systems where data security is assumed to be “someone else’s problem” — the tool returns data (and it’s the tool’s job to filter), or the tool returns data and the agent is responsible for not leaking it, or the database is responsible for enforcing access. When responsibilities are unclear, all of them get missed. Most teams discover access-scope failures only after an audit, a user complaint, or a compliance check reveals that one customer’s agent had access to another customer’s data. The mitigation that recurs across nearly every pattern here is the same architectural move — make access control explicit and testable at every layer: implement access checks at the tool level (what data is returned), at the agent level (how agents handle returned data), and at the call level (which agents can call which tools with which scopes). Never assume any layer will enforce access on its own.
Frequently Asked Questions
Per PII Field Exposure and Sensitive Field Access Not Restricted, tools should filter responses based on caller’s access level: classify each field (public, internal, sensitive, PII), check caller’s access level, and return only fields the caller can access. Don’t rely on agents to filter — they will leak fields unless explicitly trained not to.
What’s the difference between record-level and field-level access control?
Record-level access control determines whether you can access a record at all (e.g., can agent A access customer 123’s record?). Field-level access control determines which fields within that record you can see (e.g., can agent A see customer 123’s SSN field?). Both are necessary — record-level alone is insufficient because you can access the record but see restricted fields within it.
How do you test access control comprehensively?
Per Access Control Inheritance Wrong and Workspace Isolation Bypass, test access control with multiple agents in different roles/workspaces accessing the same tool and verifying that each agent sees only the fields they should. Use property-based testing: for each agent and field combination, verify that access is either granted or denied consistently, and access decisions are based on explicit rules, not absence of restriction.
Can masking alone prevent PII leakage?
Partially — per Masked Field Unmasking, masking at the API level (tool returns masked values) is insufficient if agents reason over cached or logged data. Mask at the storage layer (tools never see unmasked values) or implement masking at multiple layers (API + cache + logs). Don’t assume masking at one layer protects you everywhere.
Patterns
Total: 16 patterns