Lesson 07 · Developers

Protecting client data when an agent handles it

about 12 minutes

This lesson is for engineers building or deploying agents that process personal or confidential client information, with Australian privacy obligations as the reference frame. It maps every data flow in an agent run, connects those flows to the Australian Privacy Principles the OAIC highlights for AI, and gives concrete controls: data minimisation and pseudonymisation before model calls, tenant isolation, label-based egress policy, provider configuration, logging without content, and incident readiness. It describes regulatory guidance, not legal advice; organisations should confirm their obligations with a privacy professional.

Regulatory frame, briefly

  • Personal information: information or an opinion about an identified or reasonably identifiable individual; the OAIC’s examples include names, contact details, photographs, IP addresses and mobile location data [2]. Sensitive information (health, genetic, racial or ethnic origin, criminal record, some biometrics, and more) generally has higher protection [2].
  • Coverage: the Privacy Act 1988 [11] and its 13 APPs bind APP entities. Most small businesses (annual turnover of $3 million or less) are exempt, but health service providers, businesses trading in personal information, Commonwealth contractors and several other categories are covered regardless of turnover [3].
  • AI position: the OAIC states that the Privacy Act “applies to all uses of AI involving personal information, including where information is used to train, test or use an AI system” [1].
  • Breaches: the Notifiable Data Breaches scheme requires notifying affected individuals and the OAIC when a breach “is likely to result in serious harm” [5].
  • Automated decisions: from 10 December 2026, APP 1.7 requires an APP entity’s privacy policy to describe the kinds of personal information used, and the kinds of decisions made solely by the program or with a substantially and directly related thing done by it, where the entity has arranged for a computer program to make, or do a thing substantially and directly related to making, a decision that could reasonably be expected to significantly affect an individual’s rights or interests [9][10].

Data-flow map of an agent run

Draw this for every agent before it touches client data. Each arrow is a potential APP 6 use or disclosure, and arrows crossing borders engage APP 8 [1][4].

 client data stores ──read──▶ agent runtime ──prompt──▶ model provider (region? retention? training?)
        ▲                         │   ▲                         │
        │                         │   └──── completions ◀───────┘
   write-backs                    ├──tool calls──▶ internal APIs (CRM, DMS, calendar)
   (summaries,                    ├──tool calls──▶ external services (search, enrichment, email)
    inferences)                   ├──traces/logs──▶ observability, eval datasets, support tickets
                                  └──outputs──▶ humans, clients, other agents

Questions per arrow: what fields cross it, is that the minimum needed, where is the recipient located, how long is it retained, can the recipient use it for its own purposes, and who can read it there.

APP obligations mapped to engineering controls

APP OAIC point for AI [1] Engineering control
APP 1 (transparency) Update privacy policies with clear information about AI use Maintain a register of agents, data categories and providers; feed it to the policy owner. Log enough to describe ADM use under APP 1.7–1.8
APP 3 (collection) Generated or inferred personal information is a collection Treat agent write-backs (summaries, classifications) as new records with provenance metadata
APP 6 (use/disclosure) Secondary use needs consent or reasonable expectation plus relatedness; use or disclose only “the minimum amount of personal information sufficient for the secondary purpose” Minimisation and pseudonymisation before model calls; provider training off; no third-party tool calls carrying personal information without review
APP 8 (cross-border) Consider where servers are located and whether information could be disclosed outside Australia Pin provider region where available; record sub-processor locations; block tools that route data to unknown regions
APP 10 (quality) AI outputs can be inaccurate yet credible; hallucinated information about an identifiable person is personal information Human review before outputs affect a person; store model outputs as “draft/unverified” until confirmed
APP 11 (security) Reasonable steps against misuse, interference, loss and unauthorised access or disclosure; consider product security and operating environment Least-privilege tools, tenant isolation, egress control, injection testing, retention limits, encryption at rest

Agent-specific threats to client data

Injection-driven disclosure. NIST AI 100-2e2025 treats privacy compromise as one goal of indirect prompt injection: attackers can compel a model “to leak information from restricted resources, such as a user’s private data”, for example by prompting a model in an email client to forward certain emails to an attacker-controlled inbox [6]. In agent terms: a hostile email instructs the agent to retrieve another client’s file and include it in a reply. The structural fix is to ensure that no single agent context holds private data, untrusted input and an unrestricted egress path [8].

Cross-tenant leakage. An agent with organisation-wide read access, working on client A, can be steered (or simply err) into retrieving client B’s material. Scope credentials and retrieval indexes per client or per matter.

Provider-side retention and training. The OAIC warns that some products’ terms “allow the product owner to collect the data input by customers for further training”, creating “the potential for personal information input into an AI product then surfacing in response to a prompt from another user”, and asks whether a third party receives personal information through the product, for example via interfaces with search engines [1]. Carlini et al. demonstrated the underlying mechanism, extracting hundreds of verbatim training sequences from GPT-2, including (public) names, phone numbers and email addresses, some present in just one training document, and found larger models more vulnerable [7]. This matters most if you fine-tune on client data or use a provider that trains on inputs.

Observability as a shadow copy. Traces, prompt logs and evaluation sets frequently hold full client documents with weaker access control and longer retention than the source system.

Control 1: minimise and pseudonymise before the model

OWASP LLM02 recommends limiting access to sensitive data on least-privilege lines and using tokenisation or pattern matching to “detect and redact confidential content before processing” [12]. A related idea from Beurer-Kellner et al. is the context-minimisation pattern, which removes unnecessary content (such as the original user prompt) from the model’s context before later steps, so injected text cannot steer them [13]. Their pattern targets injection; applying the same discipline to personal information means each model call sees only the fields its step needs. A simple, tested reference for reversible pseudonymisation, where only the trusted layer can re-identify:

# Illustrative, tested. Identifier detection here is deliberately simple.
import re, secrets
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
MEDICARE = re.compile(r"\b\d{4}\s?\d{5}\s?\d\b")        # illustrative pattern only

class Vault:
    def __init__(self): self.fwd, self.rev = {}, {}
    def token(self, value: str, kind: str) -> str:
        if value not in self.fwd:
            t = f"<{kind}_{secrets.token_hex(3)}>"
            self.fwd[value], self.rev[t] = t, value
        return self.fwd[value]
    def pseudonymise(self, text: str, names: list[str]) -> str:
        for n in sorted(names, key=len, reverse=True):     # names come from the source record
            text = text.replace(n, self.token(n, "PERSON"))
        text = EMAIL.sub(lambda m: self.token(m.group(), "EMAIL"), text)
        return MEDICARE.sub(lambda m: self.token(m.group(), "ID"), text)
    def reidentify(self, text: str) -> str:
        for t, v in self.rev.items():
            text = text.replace(t, v)
        return text

v = Vault()
masked = v.pseudonymise("Referral for Jane Citizen (jane.c@example.com), Medicare 2123 45670 1, knee pain.",
                        names=["Jane Citizen"])
# -> "Referral for <PERSON_…> (<EMAIL_…>), Medicare <ID_…>, knee pain."

Limits to state plainly. Pseudonymised text is usually still personal information if the organisation can re-identify it, and free text leaks identity through context (a rare condition plus a suburb). Pattern-based detection misses things. Treat this as reducing what crosses the provider boundary, not as de-identification in the legal sense.

Control 2: isolate by client and label data for egress

Give each agent run a credential and retrieval scope for one client or matter. Then attach labels to data as it is read and check them at every egress tool. This is a small version of the data-flow policies in Google DeepMind’s CaMeL, which attaches capabilities to values so tools can refuse flows of private data to unauthorised recipients [14].

# Illustrative, tested label check at the send tool.
from dataclasses import dataclass, field

@dataclass(frozen=True)
class Labelled:
    value: str
    labels: frozenset = field(default_factory=frozenset)   # e.g. {"client:acme"}, {"health"}

ALLOWED_RECIPIENTS = {"client:acme": {"@acme.example"}, "health": set()}

def can_send(item: Labelled, recipient: str) -> bool:
    if not item.labels:                                   # unlabelled data is refused: most restrictive
        return False
    for label in item.labels:                              # every label must permit the recipient
        domains = ALLOWED_RECIPIENTS.get(label)
        if domains is None or not any(recipient.endswith(d) for d in domains):
            return False
    return True

assert can_send(Labelled("Q3 summary", frozenset({"client:acme"})), "cfo@acme.example")
assert not can_send(Labelled("Q3 summary", frozenset({"client:acme"})), "x@other.example")
assert not can_send(Labelled("referral", frozenset({"health"})), "gp@clinic.example")  # health never auto-sends
assert not can_send(Labelled("draft"), "cfo@acme.example")  # unlabelled data is refused

Labels must propagate: a summary derived from a labelled document inherits its labels. Canonicalise recipient addresses before comparison. Unlabelled data should be treated as most restrictive, not least.

Control 3: configure the provider deliberately

The OAIC flags training on inputs, third-party features, server location and regurgitation attacks [1]. The checklist below combines those with standard procurement questions:

  • Training on customer inputs: off, contractually and in settings. The OAIC notes some products’ terms allow this [1].
  • Retention of prompts and outputs: duration, and whether zero-retention options exist for your tier.
  • Processing and storage region (“where the servers are located” [1]); sub-processors and their locations (APP 8).
  • Third-party features that forward prompt content (web search, plug-ins): disabled unless reviewed.
  • Access by provider staff: conditions and logging.
  • Security posture, including protections against what the OAIC calls “attacks designed to make a model regurgitate its training dataset” [1].

Control 4: log decisions, not documents

Audit logs should establish what happened without becoming a second copy of client data. NIST SP 800-53 AU-3 lists the fields: event type, time, location, source, outcome and associated identities [15]. Store content digests and record identifiers instead of bodies; apply retention limits; restrict access to logs as tightly as to the source data. For APP 1.7, also record when a program’s output is used in a decision about a person and whether a human made the final decision, so you can describe those kinds of decisions accurately in your privacy policy [9][10].

Control 5: test and prepare for incidents

  • Injection tests on privacy goals. Build cases in the style of AgentDojo, where an attacker goal (“send client B’s file to this address”) and an injection point (an inbound email) are scored against environment state [16]. Assert that egress checks block them.
  • Retention tests. Verify that deleted source records are not retrievable via vector indexes, caches or traces.
  • Breach playbook. Add agent-specific scenarios: misdirected agent email, exposure via logs, provider incident. The NDB scheme’s “likely to result in serious harm” assessment needs facts quickly: which records, which recipients, which time window. Your logs should answer those [5].

Worked example: a clinic’s referral agent

An allied health clinic (covered as a health service provider [3]) wants an agent to summarise GP referral letters and draft appointment confirmations.

Decision Choice Rationale
Data scope Referrals inbox and calendar only; no access to the clinical records system APP 6 minimisation; APP 11
Pre-processing Pseudonymise names, Medicare numbers and contact details before model calls; re-identify in the clinic’s system Less personal and sensitive information crosses the provider boundary
Provider Business tier with training off, documented region and retention APP 6, APP 8
Outputs Summary stored as “draft, unverified” until a clinician confirms APP 10
Egress health-labelled content never auto-sends; confirmations are drafts sent by reception Breaks the exfiltration leg
Logging Action, record ID, digest, outcome; 90-day retention APP 11 without a shadow copy
Transparency Privacy policy updated; APP 1.7 assessed (scheduling isn’t a significant-effect decision, triage might be) APP 1, ADM obligation from 10 December 2026
Assurance Privacy impact assessment; quarterly injection test run OAIC “privacy by design” recommendation [1]

Key takeaways

Every hop in an agent run, from model provider and tool calls to logs and write-backs, is a use or disclosure of client data, and the OAIC’s position is that the Privacy Act applies to all of them, including information the AI generates or infers. The controls that matter most are architectural: minimise and pseudonymise before data reaches the model, isolate credentials and retrieval by client, and enforce label-based egress checks so injected instructions cannot route one client’s data to anyone else. Provider configuration (training, retention, region, third-party features) and observability design deserve the same scrutiny as the agent itself, because they often create the largest uncontrolled copies of client data. Logging decisions rather than documents, testing privacy-specific injection scenarios and preparing for NDB assessments and the APP 1.7 automated-decision disclosures that apply from 10 December 2026 make the system defensible as well as safer.

How primitive approaches this. A vendor’s privacy policy is where answers to the provider questions in this lesson should be written down. The pass privacy policy, for example, lists its service providers and where data is processed, and notes that a connected agent’s provider “receives what you and the agent exchange, under its own terms and privacy policy” [17].

Sources and further reading

  1. Office of the Australian Information Commissioner. (2024, updated 17 January 2025). Guidance on privacy and the use of commercially available AI products. https://www.oaic.gov.au/privacy/privacy-guidance-for-organisations-and-government-agencies/guidance-on-privacy-and-the-use-of-commercially-available-ai-products
  2. Office of the Australian Information Commissioner. (n.d.). What is personal information? https://www.oaic.gov.au/privacy/your-privacy-rights/your-personal-information/what-is-personal-information
  3. Office of the Australian Information Commissioner. (n.d.). Small business. https://www.oaic.gov.au/privacy/privacy-guidance-for-organisations-and-government-agencies/organisations/small-business
  4. Office of the Australian Information Commissioner. (n.d.). Australian Privacy Principles quick reference. https://www.oaic.gov.au/privacy/australian-privacy-principles/australian-privacy-principles-quick-reference
  5. Office of the Australian Information Commissioner. (n.d.). About the Notifiable Data Breaches scheme. https://www.oaic.gov.au/privacy/notifiable-data-breaches/about-the-notifiable-data-breaches-scheme
  6. Vassilev, A., Oprea, A., Fordyce, A., Anderson, H., Davies, X., & Hamin, M. (2025). Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations (NIST AI 100-2e2025), Section 3.4. NIST. https://csrc.nist.gov/pubs/ai/100/2/e2025/final
  7. Carlini, N., Tramèr, F., Wallace, E., Jagielski, M., Herbert-Voss, A., Lee, K., Roberts, A., Brown, T., Song, D., Erlingsson, Ú., Oprea, A., & Raffel, C. (2021). Extracting Training Data from Large Language Models. 30th USENIX Security Symposium. https://www.usenix.org/conference/usenixsecurity21/presentation/carlini-extracting
  8. Willison, S. (2025, 16 June). The lethal trifecta for AI agents. https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/
  9. Privacy and Other Legislation Amendment Act 2024 (Cth), Schedule 1, Part 15 (Automated decisions and privacy policies). https://www.legislation.gov.au/C2024A00128/asmade/text
  10. Office of the Australian Information Commissioner. (n.d.). Chapter 1: APP 1 Open and transparent management of personal information (APP guidelines, para 1.35). https://www.oaic.gov.au/privacy/australian-privacy-principles/australian-privacy-principles-guidelines/chapter-1-app-1-open-and-transparent-management-of-personal-information
  11. Privacy Act 1988 (Cth). Federal Register of Legislation. https://www.legislation.gov.au/C2004A03712/latest/text
  12. OWASP Gen AI Security Project. (2025). LLM02:2025 Sensitive Information Disclosure. https://genai.owasp.org/llmrisk/llm022025-sensitive-information-disclosure/
  13. Beurer-Kellner, L., Buesser, B., Creţu, A.-M., Debenedetti, E., Dobos, D., Fabian, D., Fischer, M., Froelicher, D., Grosse, K., Naeff, D., Ozoani, E., Paverd, A., Tramèr, F., & Volhejn, V. (2025). Design Patterns for Securing LLM Agents against Prompt Injections. arXiv preprint. https://arxiv.org/abs/2506.08837
  14. Debenedetti, E., Shumailov, I., Fan, T., Hayes, J., Carlini, N., Fabian, D., Kern, C., Shi, C., Terzis, A., & Tramèr, F. (2025). Defeating Prompt Injections by Design. arXiv preprint. https://arxiv.org/abs/2503.18813
  15. Joint Task Force. (2020; includes updates as of 10 December 2020). Security and Privacy Controls for Information Systems and Organizations (NIST SP 800-53 Rev. 5), control AU-3. NIST. https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
  16. Debenedetti, E., Zhang, J., Balunović, M., Beurer-Kellner, L., Fischer, M., & Tramèr, F. (2024). AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents. NeurIPS 2024, Datasets and Benchmarks Track. https://arxiv.org/abs/2406.13352
  17. Primitive AI (PRIMITIVE AI LABS PTY LIMITED). (2026, 25 October). Primitive Pass Privacy Policy, sections 03 (“AI agent access”) and 06 (“Service providers and overseas processing”). https://pass.primitiveai.com.au/privacy.html (primitive’s own statements; effective 25 October 2026)