Inspiration

Financial institutions handle enormous amounts of sensitive customer information every day, including credit card numbers, phone numbers, email addresses, bank account details and financial records.

However, not every employee needs access to all this information. Giving unrestricted access to raw database records creates serious privacy and security risks.

We wanted to address this challenge by building VeilDB, a lightweight data protection engine that makes sensitive information accessible only according to a user's permissions.

Our inspiration was simple: protecting customer privacy should not require changing the original database or maintaining separate copies of sensitive data.

What it does

VeilDB automatically identifies sensitive information stored in databases and dynamically masks it based on user roles and access permissions.

Key features include:

  • Automated PII Detection: Scans database schemas, column names and sample records to identify sensitive information.
  • Intelligent Classification: Categorizes detected fields into PII_HIGH, PII_MEDIUM and FINANCIAL_CONFIDENTIAL.
  • Role-Based Access Control: Supports Admin, Support and Analyst roles with different access privileges.
  • Dynamic Data Masking: Applies full redaction, partial masking and hashing depending on user permissions.
  • Query Protection: Blocks queries that could reveal masked values, such as UNION queries, subqueries, and filtering or sorting on masked columns.
  • Original Data Preservation: Applies masking to query results without modifying the underlying database records.
  • Audit Logging: Records each access decision without storing raw SQL or result values.

How we built it

We built VeilDB using a modular Python-based architecture.

Backend and Database Layer

  • Python
  • FastAPI
  • SQLAlchemy
  • sqlglot
  • SQLite

PII Detection and Security

  • Python Regex
  • Rule-Based Classification
  • Custom Role-Based Access Control (RBAC)
  • HMAC-SHA256 Hashing
  • Dynamic Masking Algorithms

Frontend and Visualization

  • Streamlit
  • Pandas

The system follows a modular workflow:

  1. Connect to a supported database.
  2. Scan database schemas and sample records.
  3. Identify and classify sensitive columns.
  4. Retrieve the querying user's role and permissions.
  5. Determine the appropriate masking policy.
  6. Apply masking to query results before returning them.
  7. Display protected results through an interactive dashboard.

The original database records remain untouched throughout the process.

Challenges we ran into

One of our biggest challenges was designing a reliable PII detection mechanism that could identify sensitive information without depending entirely on column names.

We addressed this by combining column-name analysis, regex pattern matching and value validation.

Other challenges included:

  • Reducing false positives during sensitive-data classification.
  • Designing a common abstraction layer for database access.
  • Implementing consistent masking strategies for different data types.
  • Ensuring that access policies are enforced on the backend rather than relying on frontend restrictions.
  • Maintaining the integrity of original database records.
  • Designing clear integration boundaries between the detection engine and query execution engine.

Accomplishments that we're proud of

We are proud of designing VeilDB as a modular security solution rather than a collection of independent masking scripts.

Our key accomplishments include:

  • Designing an automated PII detection and classification architecture.
  • Developing configurable masking strategies for different sensitivity levels.
  • Defining role-specific access policies for Admin, Support and Analyst users.
  • Finding and closing real masking bypasses, then covering them with 174 passing automated tests.
  • Deploying a working public demo on fictional data.
  • Establishing an integration workflow between PII detection, policy enforcement and query execution.
  • Building the foundation for protecting sensitive information without modifying original records.

Most importantly, we are working towards making data privacy an integral part of database access rather than an additional step performed after data retrieval.

What we learned

Through this project, we explored the importance of data privacy, database security and role-based access control.

We learned:

  • How database metadata can be used to identify sensitive information.
  • How regex and validation rules can support automated PII detection.
  • How dynamic data masking differs from permanently modifying stored data.
  • How RBAC can enforce different levels of data visibility.
  • Why backend-level security enforcement is essential.
  • How database abstraction improves portability and maintainability.
  • The importance of modular architecture and clear team integration contracts.

We also gained practical experience in designing a security-focused application with multiple interconnected components.

Validation

174 automated tests pass. On synthetic data, detection reached precision 0.685 and recall 1.000 with descriptive column names, and precision 0.615 and recall 0.727 with opaque column names.

Limitations

VeilDB is a prototype tested on SQLite with fictional data. The detector over-flags some dates and reference numbers, and it misses person names, passports, and numeric salaries when column names are opaque. The demo's role selector is for demonstration only. Audit events in memory reset when the API restarts.

What's next for VeilDB

We envision VeilDB evolving into a comprehensive data privacy and protection platform.

Our future plans include:

  • Testing and expanding database support to PostgreSQL, MySQL, and other database systems.
  • Introducing more advanced PII detection techniques.
  • Supporting customizable masking policies.
  • Adding durable audit storage and security analytics.
  • Adding policy management and real-time configuration updates.
  • Exploring machine-learning-assisted sensitive-data classification.
  • Developing advanced SQL query interception and database proxy capabilities.
  • Improving deployment through Docker and cloud infrastructure.

Our long-term vision is to make VeilDB a lightweight, extensible and database-agnostic security layer that helps organizations protect sensitive information while maintaining the usability of their existing databases.

Team

Team name: VeilDB

Vaishnavi Papnoi: Database connectivity, SQLAlchemy integration, SQL query execution and interception engine, FastAPI backend, Streamlit dashboard, frontend-backend integration, and dashboard UI/UX.

D. Lidiya: PII detection and classification, sensitive data pattern validation, dynamic masking strategies, and role-based access control (RBAC).

Tuan Nguyen: Query security hardening, API key authentication, masking fixes, audit logs, detector evaluation, deployment, presentation, and demo video.

Built with open-source libraries credited in the README. Generative AI tools assisted development, and the video narration uses an AI-generated voice.

Built With

Share this project:

Updates

Submission history