ML & AI engineering · Fabian Tax
AI security: developer and SaaS
An agent working on your code and an AI feature serving your customers face different risks. I look at both: who can access what, where untrusted content enters, and what happens before an action is allowed.
Security for the developer
Protect the developer, code and delivery pipeline when an agent can read files and use tools.
- 01 · Before an agent starts
- Scope the task and apply least privilege to credentials, files and tools. Treat repositories, issues and web pages as untrusted data: prompt injection can attempt to hijack an agent’s goal.
- 02 · During execution
- Use a sandbox or container for risky work, restrict filesystem and network access, and gate sensitive tool calls. NVIDIA OpenShell is one sandboxing option; its protection depends on the policy configured. Local inference is not necessarily air-gapped.
- 03 · Before commit
- Review the staged diff and run pre-commit checks such as secret scanning and relevant linting. In this repository the hook uses Gitleaks on staged content; it warns and skips that scan if Gitleaks is absent, so CI remains important.
- 04 · Pull request and CI
- Run tests, secret and dependency scans, and independent review against the proposed change. Branch protection and scoped credentials help prevent the agent from bypassing the review path.
- 05 · Release and operations
- Keep explicit approval for destructive actions and public releases. Use least-privilege runtime secrets, audit trails and monitoring to investigate incidents and support recovery.
Security for AI in a multi-tenant SaaS app
Protect each customer and their data when a shared application uses models, retrieval and tools on their behalf.
- Tenant identity and authorisation
- Authenticate users and enforce tenant and user permissions on every request, retrieval query and tool action. Do not trust a tenant ID supplied by the model: that creates a confused-deputy risk.
- Tenant data isolation
- Scope documents, embeddings, indexes, caches, conversation history and background jobs to the authorised tenant. Test cross-tenant access and leakage paths.
- Untrusted content and tool use
- Treat user input, retrieved content and tool output as untrusted. Protect against RAG poisoning and prompt injection; authorise MCP and other tool actions outside the model before side effects.
- Privacy and provider boundaries
- Minimise and protect PII and other sensitive data in prompts, outputs, traces and logs. Define provider data-handling, retention and deletion rules for each deployment.
- Abuse, cost and oversight
- Apply quotas, rate and cost limits, monitor failures and suspicious usage, and red-team tenant isolation and injection scenarios. No single guardrail guarantees safety.
Tools and reference points
The controls above are a design and review approach, not a claim that every control is deployed in every project. For example, this site's pre-commit hook scans staged changes with Gitleaks when installed; it warns and skips the scan when it is absent.
Tools I consider include NVIDIA OpenShell for agent sandboxing, Gitleaks for secret scanning, Trivy for vulnerability and configuration scanning, and OpenTelemetry for traces and observability.
Further guidance: OWASP Top 10 for Agentic Applications and the NIST AI Agent Standards Initiative .