⚡ AI Expert
AI security & governance 7 min read

Data governance, privacy and security in AI projects

Share

Illustration: a shield with a padlock at the center of a data network

Governing an AI project means deciding which data may be used, where it is processed, who reviews the outputs and how incidents are handled, before going to production. In Tunisia, the legal starting point is Organic Law No. 2004-63 on the protection of personal data; the GDPR and the EU AI Act come on top as soon as your customers or users are in the European Union. Public frameworks (NIST AI RMF, ISO/IEC 42001, OWASP) then provide the method.

Summary

Language models change the nature of risk: data leaves the company with every API request, instructions can be hijacked by the content being processed (prompt injection), and AI agents can act on your systems. This article covers the relevant frameworks, a five-step method for setting up governance, the security risks specific to LLM-based applications, and the minimum rules of an AI usage policy.

1. Why AI projects carry specific risks

Traditional software runs rules written by developers. A language-model-based system interprets text, which opens up new risks:

  • Data leaving the company: every request sends context (emails, documents, customer data) to the model provider, often outside Tunisia.
  • Retention and reuse: depending on the provider's terms and the plan chosen, requests may be logged; read those terms before any professional use.
  • Instruction hijacking: a document or email processed by the model may contain malicious instructions (prompt injection).
  • Inaccurate answers: a model can state false information confidently; an answer sent without review commits the company.
  • Automatic actions: an AI agent connected to tools can modify data, send messages or trigger payments.

The frameworks to know

Public texts and frameworks; official links are in the sources.
ReferenceTypeWhat it providesWhen it matters
Organic Law No. 2004-63 and INPDPTunisian lawPrinciples for processing personal data, data subject rights, supervisory authorityAs soon as a project processes personal data in Tunisia
GDPR (Regulation (EU) 2016/679)EU regulationLegal basis, minimization, security, data subject rights, transfers outside the EUCustomers, users or partners in the EU
Regulation (EU) 2024/1689 on AI (AI Act)EU regulationRisk-based approach: prohibited practices, high-risk systems, transparency obligationsAI systems placed on the EU market or whose outputs are used there
NIST AI Risk Management FrameworkVoluntary frameworkFour functions for managing risk: govern, map, measure, manageStructuring a project's risk analysis
ISO/IEC 42001:2023International standardCertifiable AI management systemOrganizations that want to formalize and audit their approach
OWASP Top 10 for LLM ApplicationsSecurity frameworkThe main vulnerabilities of LLM-based applications and countermeasuresDesign and security review of any LLM application

2. Classify data before choosing the architecture

Choosing between an external API, a cloud service and an in-house model depends first on how sensitive the data is. A simple classification is enough to start:

  • Public: information already published (catalog, website); few restrictions.
  • Internal: procedures, working documents; external APIs are possible with suitable contractual terms.
  • Confidential: contracts, financial data, source code; strict minimization, an assessed provider, or in-house processing.
  • Personal or sensitive: customer, candidate or employee data; review under Law 2004-63 (and the GDPR where applicable), anonymization or pseudonymization, and processing on controlled infrastructure where needed.

3. Securing applications built on language models

The OWASP Top 10 for LLM Applications lists the most common vulnerabilities. Four of them directly affect business projects:

Prompt injection

Processed content (email, PDF, web page) contains instructions that hijack the model. Keep instructions and data clearly separate, and never give the model more rights than it needs.

Sensitive information disclosure

The model reveals data it should not have seen or disclosed. Filter data upstream and limit the context to what the user is allowed to see.

Improper output handling

The model's response is used without checks (SQL query, command, message sent). Validate and escape any output before executing or publishing it.

Excessive agency

An agent has overly broad tools or permissions. Limit its tools, apply least privilege and require human approval for irreversible actions.

Setting up governance in 5 steps

  1. Inventory the uses

    List the AI tools already used in the company, including undeclared individual use.

  2. Map the data

    For each use: data processed, classification, processing location, provider and terms.

  3. Assess the risks

    Impact of an error, a leak or a hijack; rely on the NIST AI RMF functions.

  4. Define rules and owners

    Usage policy, human review, an owner per system, an incident procedure.

  5. Monitor and review

    Logs, periodic review of quality and incidents, updated rules.

4. The minimum rules of an AI usage policy

A short policy that is applied beats a long document that is ignored. At a minimum it should state:

  • Which tools are approved, and for which kinds of data.
  • Which data is banned from consumer tools: customer personal data, contracts, financial information, confidential source code.
  • When human review is mandatory before sending or acting.
  • Transparency: telling people when they are interacting with an AI system.
  • Log retention and the procedure for reporting an incident.

5. AI agents: limit what they can do

An AI agent does not just answer: it uses tools and acts. The most effective rule is to make its sensitive decisions deterministic: the model proposes, rule-based code decides whether the action may go out without a person. That is the principle I applied to this site's AI assistant: any reply that mentions a price, a discount, a contract, a delivery commitment or sensitive data, or that contains a prompt injection attempt, is held until a human approves it, however confident the model is. For more on agents, see AI agents and their uses.

  • Give the agent only the tools its task requires.
  • Require human approval for irreversible or binding actions.
  • Log every decision, every tool call and every approval.
  • Test the agent with malicious content before going to production.

Key takeaways

  • In Tunisia, Organic Law No. 2004-63 governs any personal data used by an AI project; the GDPR and the AI Act add to it for EU-related activity.
  • Classify data before choosing between an external API, the cloud and in-house hosting.
  • Address LLM-specific risks: prompt injection, information leaks, unchecked outputs, excessive agency.
  • Make agents' sensitive decisions deterministic: the model proposes, rules and people decide.
  • Write a short usage policy, then monitor and review it regularly.

Conclusion

Governance does not hold AI back: it is what turns isolated experiments into reliable systems that customers and employees can trust. It starts with simple decisions about data and human review, then takes shape with recognized frameworks. For the overall approach, read Integrating AI into a Tunisian business; for support, get in touch.

Sources

  1. Organic Law No. 2004-63 of 27 July 2004 on the protection of personal data (French text published by the INS, Tunisia)
  2. Regulation (EU) 2016/679 (GDPR) — EUR-Lex
  3. Regulation (EU) 2024/1689 on artificial intelligence — EUR-Lex
  4. NIST — AI Risk Management Framework (AI RMF 1.0)
  5. ISO/IEC 42001:2023 — Artificial intelligence management systems
  6. OWASP Top 10 for Large Language Model Applications

Frequently asked questions (FAQ)

Which law governs personal data in an AI project in Tunisia?

Organic Law No. 2004-63 of 27 July 2004 on the protection of personal data, enforced by the INPDP. The GDPR also applies when processing concerns people located in the European Union.

Does the EU AI Act apply to a Tunisian company?

It can, if the company places an AI system on the EU market or if its system's outputs are used there, for example for European customers. A case-by-case analysis is needed.

What is prompt injection?

An attack in which content processed by the model (email, document, web page) contains instructions meant to hijack its behavior, for example to disclose data or trigger an action. It tops the OWASP Top 10 for LLM Applications.

Do we need to host our own model to protect our data?

Not always. For public or internal data, an API with suitable contractual terms may be enough. For personal or confidential data, anonymization, an assessed provider or a model hosted on controlled infrastructure become necessary.

How do we keep an AI agent that acts on our systems under control?

By limiting its tools to what is strictly needed, requiring human approval for irreversible or binding actions, logging every action and testing the agent with malicious content before production.

An AI project or training for your team?

Let's talk about your context: tailored training, AI agent integration or process automation.