Observed since 21 Oct, 10:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Official AIIA SDK for logging AI actions with legal and operational traceability - 100% Plug & Play
The official SDK for integrating the AIIA protocol (Artificial Intelligence Interaction Agreement) into your AI systems.
This library allows AI applications to log actions in a secure, auditable, and legally traceable way.
Instala el SDK:
pip install AIIA_TEST
Configura tus credenciales en .env:
AIIA_API_KEY=tu_api_key
AIIA_CLIENT_SECRET=tu_client_secret
AIIA_IA_ID=tu_ia_id
Integra según tu framework:
from aiia_sdk import AIIA
aiia = AIIA()
# ¡NO necesitas registrar el middleware manualmente! El SDK lo hace por ti si detecta el framework.
# Solo en casos edge o si disables la auto-inyección, consulta la documentación avanzada.
# settings.py
MIDDLEWARE = [
...
'aiia_sdk.middleware_django.AIIAMiddleware',
...
]
# apps.py o arranque
from aiia_sdk import AIIA
from aiia_sdk.middleware_django import AIIAMiddleware
aiia = AIIA()
AIIAMiddleware.aiia = aiia
⚠️ Django requiere pasos manuales por limitaciones del framework.from aiia_sdk import AIIA
aiia = AIIA()
output = "respuesta de tu IA"
aiia.analyze_output(output)
The AIIA SDK enables developers to integrate plug & play action logging and auditing into any AI-based system. It offers a dual-layer logging mechanism:
registered or non_registered.from aiia_sdk import AIIA
from aiia_sdk.middleware_fastapi import AIIAMiddleware
from fastapi import FastAPI
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
app = FastAPI()
app.add_middleware(AIIAMiddleware, aiia_instance=aiia)
Con esto, todas las respuestas de tu API serán analizadas automáticamente y registradas en AIIA sin modificar tus endpoints.
from aiia_sdk import AIIA
from aiia_sdk.middleware_flask import AIIAMiddleware
from flask import Flask
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
app = Flask(__name__)
AIIAMiddleware(app, aiia)
Esto intercepta todas las respuestas y las analiza automáticamente.
from aiia_sdk import AIIA
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
# En tu settings.py añade:
MIDDLEWARE = [
...
'aiia_sdk.middleware_django.AIIAMiddleware',
...
]
# En tu AppConfig o arranque, asegúrate de pasar la instancia de AIIA:
from aiia_sdk.middleware_django import AIIAMiddleware
AIIAMiddleware.aiia = aiia # (alternativamente, puedes modificar el middleware para soportar inyección directa)
Esto intercepta todas las respuestas HTTP y las analiza automáticamente.
Si tu IA no usa ninguno de los frameworks anteriores, puedes analizar cualquier salida relevante de la IA con:
from aiia_sdk import AIIA
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
output = "texto de salida de tu IA o respuesta de API"
aiia.analyze_output(output)
Esto funciona en cualquier framework, script o entorno.
.env a repositorios públicos.Install the SDK and its dependencies using pip:
pip install aiia-sdk
If you are developing locally, you may also want to install:
pip install python-dotenv sentence-transformers cryptography tldextract
For maximum security, store your credentials in a .env file at the root of your project:
AIIA_API_KEY=your_api_key_here
AIIA_CLIENT_SECRET=your_client_secret_here
AIIA_IA_ID=your_ia_id_here
Never commit your .env file to version control.
The SDK will automatically load these variables when you initialize the AIIA class. This keeps your secrets out of the codebase and version control.
You can also override these values by passing them directly as arguments when creating the AIIA instance, but using a .env file is the recommended and most secure approach.
.env file or as environment variables, never commit them to version control.Warning: When you create or regenerate your API key or client secret in the dashboard, you will only see it ONCE. Copy and store it securely. If you lose it, you must regenerate it.
sentence-transformers), you will see a warning and semantic detection will be disabled.Tip: For production, you may want to redirect or capture these logs to your own logging system.
.env or any credentials in your version control or public repositories..env file, API keys, client secrets, or IA IDs with anyone outside your organization.To remove the SDK:
pip uninstall aiia-sdk
analyze_outputfrom aiia_sdk import AIIA
from aiia_sdk.middleware_fastapi import AIIAMiddleware
from fastapi import FastAPI
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
app = FastAPI()
app.add_middleware(AIIAMiddleware, aiia_instance=aiia)
@app.get("/demo")
def demo():
return {"result": "La IA ha enviado un email"}
from aiia_sdk import AIIA
from aiia_sdk.middleware_flask import AIIAMiddleware
from flask import Flask
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
app = Flask(__name__)
AIIAMiddleware(app, aiia)
@app.route("/demo")
def demo():
return "La IA ha enviado un email"
# settings.py
MIDDLEWARE = [
...
'aiia_sdk.middleware_django.AIIAMiddleware',
...
]
# apps.py o arranque
from aiia_sdk import AIIA
from aiia_sdk.middleware_django import AIIAMiddleware
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
AIIAMiddleware.aiia = aiia # (alternativamente, puedes modificar el middleware para soportar inyección directa)
from aiia_sdk import AIIA
aiia = AIIA(api_key="...", client_secret="...", ia_id="...")
output = "La IA ha accedido a un documento confidencial"
aiia.analyze_output(output)
By installing the AIIA SDK, developers agree to act responsibly in the registration of their AI's actions.
analyze_output method.aiia_actions_v1.0.json), developers must contact javier.sanchez@aiiatrace.com to request its inclusion.non_registered column exists as a transparency mechanism so that companies can monitor undeclared activity.non_registered, a notification will be sent requiring them to review and properly register those actions.analyze_output method to ensure every action is properly logged. If a particular action does not yet exist in the official dictionary, this will not result in warnings provided the developer notifies AIIA via email at javier.sanchez@aiiatrace.com.Within the AIIA portal, companies will be able to:
This structure ensures that both developers and companies uphold the standards of safe, auditable AI.
This SDK is released under the MIT License. See LICENSE for more information.
MIT License. Consulta el archivo LICENSE para más información.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.4 | 5 Jul 2025 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:59c67fbaedfbc5ebc061a09c58a660ca0635e2ca4db6103bd3f862e9015cecab