Installation
Run the following command to install Netra in your environmentOptional Dependencies
Netra SDK supports optional dependencies for enhanced functionality:Presidio for PII Detetcion
To use the PII detection features provided by Netra SDK:If you try to use the PII detection utility in Netra SDK without installing this dependency, you will receive an exception. So, always make sure to install the package if you plan to use this utility.
LLM-Guard for Prompt Injection Protection
To use the full functionality of prompt injection scanning provided by llm-guard:The 
llm-guard
package has a dependency on PyTorch, which may cause installation issues on Intel Mac machines. The base SDK will install and function correctly without llm-guard, with limited prompt injection scanning capabilities. When llm-guard
is not available, Netra will log appropriate warnings and continue to operate with fallback behavior.
Initialization
API Key Configuration
To enable Netra SDK tracing, you need to provide an API key. You can obtain your API key from the Netra dashboard.
Environment Variable Configuration
Add the following environment variables to your application to enable Netra SDK tracing.Code Snippet
Follow the code below to initialize Netra in you application. By default, Netra will instrument all the installed packages.Decorators for Easy Instrumentation
Netra SDK provides decorators like@workflow
, @agent
, and @task
for easy instrumentation of your code. For more details and usage examples, please refer to the Decorators section in our documentation.