Skip to main content
Tusi
Trust and compliance

Security

Principles for protecting routes, data, user input, and AI services across the Tusi architecture.

9 min readSecurity by design
Verified against the current implementation
01

Responsibility model

Security is not a final project layer. Authentication, authorization, data protection, and observability should evolve with the primary product flow.

02

Authentication and access control

The platform uses NextAuth with JWT-backed sessions and distinct roles. Admin and dashboard routes are protected by the proxy layer, while sensitive APIs must also authorize on the server.

  • Apply least privilege to every role
  • Re-check authorization inside route handlers
  • Never trust a role or userId supplied by the client
03

Input and data

Validate all input with a schema before using or storing it. Uploaded files require controls for type, size, and safe naming.

  • Validate with Zod at data boundaries
  • Use parameterized queries through Prisma
  • Do not expose internal error details to users
  • Remove or mask sensitive data in logs
04

AI-specific threats

Retrieved content, model output, and instructions inside files are untrusted data. They must not grant tool authority or new access.

  • Separate system instructions from user and document content
  • Use allowlists for tools and network destinations
  • Require human confirmation for high-impact actions
  • Evaluate prompt injection and data exfiltration before release
05

Report a security issue

To report a vulnerability privately, send reproduction details and potential impact through the contact page. Avoid public disclosure before coordination.

Did this guide miss your question?
Send your technical context to our team and we will help identify the right path.