> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quixa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# QPlugin Architecture & Sandboxed Extensions

> Extend Quixa with custom transformation logic, enterprise data masking, and proprietary SDK adapters.

When visual nodes and basic scripts are insufficient, **QPlugins** provide a modular, reusable plugin ecosystem for custom data processing, proprietary cryptographic signatures, and enterprise payload transformations.

***

## 1. Plugin Execution Architecture

QPlugins run inside containerized, isolated worker threads (`quixa-resolver` microservice):

* **Crash Isolation**: Each plugin executes within a dedicated `worker_threads` instance with a 10-second hard execution ceiling. A crashing plugin cannot impact platform stability.
* **Code Sandboxing**: V8 Virtual Machine (`vm`) sandbox with strict blocking of dangerous globals (`eval`, `process`, file system, arbitrary socket access).
* **Two-Phase Compatibility**: Supports both standard named-function plugins (`function transform(input)`) and modern expression scripts (`({ output: value })`).

***

## 2. Creating a Custom Plugin

Admins and Developers can author plugins directly in the **Plugin Editor**:

```javascript theme={null}
/**
 * QPlugin: Mask Sensitive PII (TCKN & Credit Card)
 * @param {Object} input - Inbound JSON payload
 * @returns {Object} Sanitized JSON payload
 */
function transform(input) {
  if (!input || typeof input !== 'object') return input;
  
  const sanitized = JSON.parse(JSON.stringify(input));
  
  // Mask 11-digit TCKN / National IDs
  if (sanitized.nationalId && typeof sanitized.nationalId === 'string') {
    sanitized.nationalId = sanitized.nationalId.slice(0, 3) + '*****' + sanitized.nationalId.slice(-3);
  }
  
  // Mask 16-digit Primary Account Numbers (PAN)
  if (sanitized.cardNumber && typeof sanitized.cardNumber === 'string') {
    sanitized.cardNumber = sanitized.cardNumber.slice(0, 6) + '******' + sanitized.cardNumber.slice(-4);
  }
  
  return sanitized;
}
```

***

## 3. Reusing Plugins Across Workflows

Once published, plugins appear in the canvas component palette under **Plugins**. Developers can drag them onto any workflow to enforce standardized corporate transformations across teams.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.