- Home
- Skills
- Agents & Orchestration
- ToxicJoin Compositional SQL Privacy Review
Works with the AI Agents you already use
ToxicJoin Compositional SQL Privacy Review
Review AI-generated SQL for compositional privacy and re-identification risks using DataHub governance, field classifications, lineage analysis, and verified subject-threshold checks.
$9.99
ToxicJoin Compositional SQL Privacy Review
Example session with this skill installed
Review the following AI-generated SQL query for compositional privacy risks.
Use the following synthetic DataHub metadata fixture:
- subject_token: STABLE_PSEUDONYM
- postal_prefix: QUASI_IDENTIFIER
- age_band: QUASI_IDENTIFIER
- support_category: SENSITIVE_ATTRIBUTE
The query is
SELECT
e.subject_token,
e.postal_prefix,
e.age_band,
e.support_category
FROM demo_events AS e;
Determine whether the combination creates a privacy disclosure risk.
Explain the field classifications, query output grain, relevant risk pattern, and recommended remediation.
Do not invent missing metadata, claim a real-world re-identification event, or authorize execution. Clearly distinguish this synthetic example from a live DataHub assessment.
- Read your context and instructions
- Compiled the toxicjoin compositional sql
ToxicJoin — Compositional Privacy Review
1. Executive Summary
Assessment: BLOCK_LIKE
The submitted SQL exposes a stable pseudonym alongside multiple quasi-identifiers and a sensitive attribute at individual-row granularity.
This combination creates a compositional privacy disclosure risk.
The assessment is based on the synthetic governance metadata supplied in the request.
2. SQL Structure Analysis
The query selects four fields from demo_events.
| Field | Governance Classification | Assessment |
|---|---|---|
| subject_token | STABLE_PSEUDONYM | Stable subject linkage |
| postal_prefix | QUASI_IDENTIFIER | Geographic linkage |
| age_band | QUASI_IDENTIFIER | Demographic linkage |
| support_category | SENSITIVE_ATTRIBUTE | Sensitive disclosure |
Output grain: Individual rows.
The statement contains no GROUP BY or aggregation that would transform the output into a grouped analytical result.
3. Identified Risk
Finding: TJ-PRIV-001
Risk pattern
STABLE_PSEUDONYM + MULTIPLE QUASI_IDENTIFIERS + SENSITIVE_ATTRIBUTE
The selected attributes create a combination that can increase the potential for subject linkage and disclosure.
Although no direct identifier appears in the projection, the stable pseudonym and quasi-identifiers provide a potentially linkable subject context.
The available evidence establishes a risky disclosure condition. It does not establish that an actual person has been re-identified.
4. Recommended Remediation
Recommended actions
- Review whether the stable pseudonym is necessary for the analytical purpose.
- Evaluate whether geographic and demographic fields can be reduced or coarsened under the organization's approved policy.
- Consider a supported grouped analytical design where appropriate.
- Verify all transformed fields against their DataHub classifications and upstream lineage.
- Reparse and reassess the complete modified SQL before execution.
No arbitrary privacy threshold is proposed because the configured minimum and verified subject key were not supplied.
5. Evidence Limitations
This demonstration uses synthetic metadata supplied in the request.
No live DataHub lookup, warehouse query, or external re-identification test was performed.
A production assessment requires actual governed metadata, lineage evidence, and a compatible SQL AST parser.
6. Final Decision
| Control | Result |
|---|---|
| Compositional risk observed | YES |
| Sensitive attribute exposed | YES |
| Individual-row output | YES |
| Live DataHub verification | NOT PERFORMED |
| Execution authorization | NOT GRANTED |
| ToxicJoin runtime decision | NOT EVALUATED |
Final Assessment: BLOCK_LIKE
The query should be referred to the deterministic ToxicJoin enforcement engine and the responsible privacy policy owner before execution or release.
Connects securely to your tools. The creator never sees your data.
About this skill
ToxicJoin Compositional SQL Privacy Review
Overview
AI data agents can create serious privacy risks even when individual database fields appear harmless on their own.
ToxicJoin Compositional SQL Privacy Review helps identify these risks by examining how identifiers, pseudonyms, quasi-identifiers, and sensitive attributes combine across SQL queries.
It uses governed DataHub metadata, schema classifications, and data lineage to produce evidence-based privacy assessments.
What This Skill Does
- Compositional Privacy Analysis: Detects risky combinations of fields that may expose sensitive information.
- DataHub Governance: Reviews field classifications, metadata, and glossary terms.
- Data Lineage Analysis: Examines upstream dependencies and data relationships.
- SQL Structural Analysis: Reviews projections, joins, CTEs, filters, grouping, aggregates, and HAVING conditions.
- Subject Threshold Verification: Checks whether COUNT(DISTINCT subject_key) uses the correct governed privacy subject and a properly structured threshold.
- Evidence-Based Reporting: Produces structured findings, missing evidence, risk explanations, and remediation recommendations.
Why It Matters
Traditional SQL reviews often focus on individual columns or obvious SQL injection patterns.
ToxicJoin focuses on compositional privacy risks: combinations of otherwise acceptable fields that may enable subject identification or expose sensitive attributes.
For example, a stable pseudonym combined with geographic and demographic attributes may create a disclosure risk even when no direct identifier is selected.
Review Outcomes
The skill uses four assessment categories:
- BLOCK_LIKE
- REWRITE_CANDIDATE
- NO_TRIGGER_OBSERVED
- INSUFFICIENT_EVIDENCE
Every assessment includes its supporting evidence and limitations.
Requirements
- Read-only DataHub MCP access or an equivalent metadata interface.
- A SQL AST parser compatible with the submitted SQL dialect.
- An organization-approved field classification map.
- A configured minimum distinct-subject threshold.
Important Security Boundary
This skill is an advisory review assistant. It does not execute SQL, modify DataHub metadata, authorize data release, or replace the deterministic ToxicJoin enforcement engine.
It never issues an authoritative ALLOW decision.
Missing or ambiguous evidence results in INSUFFICIENT_EVIDENCE rather than an assumed safe outcome.
Project
Developed from the ToxicJoin open-source project:
https://github.com/Z3X-1337/toxicjoin
License: Apache-2.0
Requires DataHub metadata access and a SQL AST parser. It cannot authorize query execution or guarantee absolute anonymity. Does not support dynamic SQL or unresolved bindings.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
Requires
Permissions
Allowed Hosts
Read-only DataHub metadata and lineage access is required for evidence-based governance reviews. The skill does not execute SQL, modify warehouse data, write DataHub metadata, access credentials, or authorize data release. If required tools or governance evidence are unavailable, the skill returns INSUFFICIENT_EVIDENCE.