Login
Get Started

Node.js Client

Estimated reading: 1 minute 3 views

Node.js Client

The Carlo Node.js Client allows developers to integrate governance monitoring and ethical AI policies into JavaScript and Node.js applications.
This SDK helps validate prompts, enforce governance rules, and log AI interactions.

Installation

Install the Carlo Node.js SDK using npm.

npm install carlo-ai
Import the SDK

Import the Carlo module into your application.

const carlo = require(“carlo-ai”)

Initialize Carlo Guardian

Create a Guardian instance using your API key.

const guardian = new carlo.Guardian({
apiKey: “YOUR_API_KEY”
})

Validate a Prompt

Validate prompts before sending them to your AI model.

const prompt = “Explain artificial intelligence.”
const validatedPrompt = guardian.validatePrompt(prompt)
console.log(validatedPrompt)

If the prompt violates governance policies, Carlo will block or modify the request.

Deploy Policies

Deploy governance policies using the Guardian instance.

guardian.deployPolicy(“block_harmful_content”)

This ensures that all prompts are evaluated against the defined rules.

Monitor AI Activity

All AI interactions are logged through the Carlo platform for auditing and compliance purposes.
You can monitor activity through the Carlo dashboard.

Leave a Comment

Share this Doc

Node.js Client

Or copy link

CONTENTS
Need Help? Chat with us
Compliance Intake

Talk to Compliance Support

Share a few details so we can route you to the right compliance expert.

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.