analyze_code_ast
Detect GDPR compliance issues in Python, JavaScript, and TypeScript by analyzing source code with AST parsing, identifying cross-border data transfers, PII mishandling, and logging violations.
Instructions
Analyze code using AST for GDPR compliance (Python, JavaScript, TypeScript).
AST analysis provides higher accuracy than regex by:
Filtering out comments and string literals (reducing false positives)
Tracking variable assignments and data flow
Identifying function definitions and call sites
Verifying semantic intent of GDPR-related code
Detects:
Cross-border data transfers (third-party API imports)
PII handling in function parameters
PII logging violations
DSR implementation patterns (Art. 15-22)
Args: code: Source code to analyze file_path: Optional file path for automatic language detection language: Override language (python, javascript, typescript) deep_analysis: Include detailed function, import, and data flow info
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| file_path | No | ||
| language | No | ||
| deep_analysis | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |