Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdbc9af1

Browse files
authored
Update UI links, remove some TS / PR 2
Updated UI links, removed some TS
2 parents091a665 +6ed2c14 commitdbc9af1

21 files changed

+174
-201
lines changed

‎README.md‎

Lines changed: 5 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
#OpenAI Guardrails
22

3-
>**Choose your language:**
4-
>-[Python](#python)
5-
>-[TypeScript](#typescript)
6-
7-
---
8-
9-
#Python
10-
113
##Overview
124

135
OpenAI Guardrails is a Python package for adding robust, configurable safety and compliance guardrails to LLM applications. It provides a drop-in wrapper for OpenAI's Python client, enabling automatic input/output validation and moderation using a wide range of guardrails.
146

157
##Documentation
168

17-
For full details, advanced usage, and API reference, see here:[OpenAI GuardrailsAlphaDocumentation](https://oaig-whisper-yonder-xnjpy2.vercel.app/docs/).
9+
For full details, advanced usage, and API reference, see here:[OpenAI Guardrails Documentation](https://openai.github.io/openai-guardrails-python/).
1810

1911
##Quick Start: Using OpenAI Guardrails (Python)
2012

2113
1.**Generate your guardrail spec JSON**
22-
- Use the[Guardrails web UI](https://oaig-whisper-yonder-xnjpy2.vercel.app/) (pw:guardrails) to create a JSON configuration file describing which guardrails to apply and how to configure them.
14+
- Use the[Guardrails web UI](https://platform.openai.com/guardrails) to create a JSON configuration file describing which guardrails to apply and how to configure them.
2315
- The wizard outputs a file like`guardrail_specs.json`.
2416

2517
2.**Install dependencies**
@@ -65,7 +57,7 @@ For full details, advanced usage, and API reference, see here: [OpenAI Guardrail
6557
- The client will automatically apply all configured guardrails to inputs and outputs.
6658
- If a guardrail is triggered, a`GuardrailTripwireTriggered` exception will be raised. You should handle this exception to gracefully manage blocked or flagged content.
6759

68-
>**Note:** The Guardrails web UI(in`frontend/`)is hosted [here](https://oaig-whisper-yonder-xnjpy2.vercel.app/). Youdo not need to run the web UI yourself to use the Python package.
60+
>**Note:** The Guardrails web UI is hosted [here](https://platform.openai.com/guardrails). Youdo not need to run the web UI yourself to use the Python package.
6961

7062
---
7163

@@ -79,107 +71,6 @@ For full details, advanced usage, and API reference, see here: [OpenAI Guardrail
7971
8072
---
8173
82-
# TypeScript
83-
84-
## Overview
85-
86-
Guardrails TypeScript is a Node.js/TypeScript framework for secure AI calls with OpenAI Guardrails. It provides a port of the Python Guardrails framework with enhanced type safety, Node.js integration, and a high-level client API mirroring the Python version.
87-
88-
> **Note:** The TypeScript package is currently in development and not yet published to npm. Use the local installation methods below.
89-
90-
## Quick Start: Using OpenAI Guardrails (TypeScript)
91-
92-
### 1. Install Locally
93-
94-
Clone the repository and install dependencies:
95-
```bash
96-
# From the root of the repo
97-
cd guardrails-ts
98-
npm install
99-
npm run build
100-
```
101-
102-
You can also install it into your own project from the local path:
103-
```bash
104-
npm install /absolute/path/to/guardrails/guardrails-ts
105-
```
106-
107-
### 2. Using the Guardrails Client in TypeScript
108-
109-
The TypeScript client now provides a high-level API similar to Python:
110-
111-
```typescript
112-
import { GuardrailsOpenAI } from'@guardrails/guardrails-ts';
113-
import * as path from'path';
114-
// Create a GuardrailsOpenAI client with your config
115-
const client = await GuardrailsOpenAI.create(path.resolve('guardrails_config.json'), {
116-
apiKey: process.env.OPENAI_API_KEY,
117-
});
118-
try {
119-
const response = await client.chat.completions.create({
120-
model:'gpt-5',
121-
messages: [{ role:'user', content:'...' }],
122-
});
123-
console.log(response.llm_response.choices[0].message.content);
124-
} catch (e) {
125-
// Handle blocked or flagged content
126-
console.error('Guardrail triggered:', e);
127-
}
128-
// Example: Using the new OpenAI Responses API with Guardrails
129-
try {
130-
const resp = await client.responses.create({
131-
model:'gpt-5',
132-
input:'...',
133-
// Optionally, add file_search or other tool arguments as needed
134-
});
135-
console.log(resp.llm_response.output_text);
136-
} catch (e) {
137-
console.error('Guardrail triggered (responses API):', e);
138-
}
139-
```
140-
141-
### 3. CLI Usage
142-
143-
You can also use the CLI for validation and evaluation:
144-
145-
```bash
146-
# Run directly with npm (from guardrails-ts directory)
147-
npm run cli -- --help
148-
npm run cli -- validate config.json
149-
npm run cli -- eval --config-path config.json --dataset-path dataset.jsonl
150-
151-
# Or install globally for CLI access
152-
npm install -g .
153-
guardrails-ts --help
154-
guardrails-ts validate config.json
155-
guardrails-ts eval --config-path config.json --dataset-path dataset.jsonl
156-
```
157-
158-
### 4. Running Examples
159-
160-
```bash
161-
# Build the package first
162-
npm run build
163-
164-
# Run example scripts (from guardrails-ts/examples)
165-
cd examples
166-
npx tsx simple-runtime-usage.ts
167-
npx tsx guardrails-demo.ts
168-
```
169-
170-
---
171-
172-
## What Does the TypeScript Package Provide?
173-
174-
- **GuardrailsOpenAI** and **GuardrailsAzureOpenAI**: Drop-in replacements for OpenAI's`OpenAI` and`AzureOpenAI` clients, with automatic guardrail enforcement (mirrors Python API).
175-
-**Automatic input/output validation**: Guardrails are applied to all relevant API calls (e.g.,`chat.completions.create`,`responses.create`, etc.).
176-
-**Configurable guardrails**: Choose which checks to enable, and customize their parameters via the JSON spec.
177-
-**Tripwire support**: Optionally block or mask unsafe content, or just log/flag itfor review.
178-
-**CLI tool**: Validate configs, run evaluations, and more from thecommand line.
179-
-**Evaluation framework**: Test guardrail performance on datasets and measure metrics like precision, recall, and F1 scores.
180-
181-
---
182-
18374
## Available Guardrails
18475
18576
Below is a list of all built-in guardrails you can configure. Each can be enabled/disabled and customized in your JSON spec.
@@ -202,9 +93,9 @@ Below is a list of all built-in guardrails you can configure. Each can be enable
20293

20394
## License
20495

205-
For the duration of this early access alpha, `guardrails`(including both the Python and TypeScript packages)is distributed under the Alpha Evaluation Agreement that your organization signed with OpenAI.
96+
For the duration of this early access alpha,`guardrails` is distributed under the Alpha Evaluation Agreement that your organization signed with OpenAI.
20697

207-
Both thePythonand TypeScript packages are intended to be MIT-licensed in the future, subject to change.
98+
ThePythonpackage is intended to be MIT-licensedin the future, subject to change.
20899

209100
## Disclaimers
210101

‎docs/agents_sdk_integration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ agent = GuardrailAgent(config=JsonString('{"version": 1, ...}'), ...)
8383

8484
##Next Steps
8585

86-
- Use the[Guardrails Wizard](https://guardrails-vercel-git-main-openai.vercel.app/guardrails) to generate your configuration
86+
- Use the[Guardrails Wizard](https://platform.openai.com/guardrails) to generate your configuration
8787
- Explore available guardrails for your use case
8888
- Learn about pipeline configuration in our[quickstart](./quickstart.md)
8989
- For more details on the OpenAI Agents SDK, refer to the[Agent SDK documentation](https://openai.github.io/openai-agents-python/).

‎docs/evals.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,25 @@ python guardrail_evals.py \
2020
--models gpt-5 gpt-5-mini gpt-5-nano
2121
```
2222

23-
Test with included demo files in our[github repository](https://github.com/OpenAI-Early-Access/guardrails/tree/main/src/guardrails/evals/eval_demo)
23+
Test with included demo files in our[github repository](https://github.com/openai/openai-guardrails-python/tree/main/src/guardrails/evals/eval_demo)
2424

2525
##Dependencies
2626

27-
The evals tool requires a few extra packages that are not installed with the core`guardrails` package. Please install the following before running evaluations or benchmarks:
27+
###Benchmark Mode
28+
When running benchmark mode (ROC curves, precision at recall thresholds, visualizations), you need additional packages:
2829

2930
```bash
30-
pip installnumpy pandas matplotlib seaborn scikit-learn
31+
pip install"guardrails[benchmark]"
3132
```
3233

33-
These dependencies are only needed for the evals and benchmarking workflows (metrics and visualization), not for using`guardrails` at runtime.
34+
This installs:
35+
-`numpy>=1.24.0` - Core scientific computing
36+
-`scikit-learn>=1.3.0` - Machine learning metrics
37+
-`matplotlib>=3.7.0` - Visualization
38+
-`seaborn>=0.12.0` - Statistical plots
39+
-`pandas>=2.0.0` - Data processing
40+
41+
**Note**: These dependencies are only needed for benchmarking workflows (metrics calculation and visualization), not for basic evaluation mode.
3442

3543
##Arguments
3644

@@ -53,7 +61,7 @@ These dependencies are only needed for the evals and benchmarking workflows (met
5361

5462
Export a configuration from the Guardrails Wizard UI and pass its path via`--config-path`.
5563

56-
- Open the[Wizard UI](https://oaig-whisper-yonder-xnjpy2.vercel.app/guardrails)
64+
- Open the[Wizard UI](https://platform.openai.com/guardrails)
5765
- Configure the guardrails you want to evaluate
5866
- Use Export to download the config file (JSON)
5967
- Run the evaluator with`--config-path /path/to/exported_config.json`
@@ -190,4 +198,4 @@ python guardrail_evals.py \
190198
##Next Steps
191199

192200
- See the[API Reference](./ref/eval/guardrail_evals.md) for detailed documentation
193-
- Use[Wizard UI](https://oaig-whisper-yonder-xnjpy2.vercel.app/guardrails) for configuring guardrails without code
201+
- Use[Wizard UI](https://platform.openai.com/guardrails) for configuring guardrails without code

‎docs/examples.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#Examples
22

3-
Ready-to-run examples demonstrating Guardrails in various scenarios. See the[`guardrails/examples/`](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/) folder for complete implementations.
3+
Ready-to-run examples demonstrating Guardrails in various scenarios. See the[`guardrails/examples/`](https://github.com/openai/openai-guardrails-python/tree/main/examples/) folder for complete implementations.
44

55
##Example Implementations
66

7-
-[hello_world.py](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/basic/hello_world.py) — Basic pipeline configuration with input/output guardrails
8-
-[agents_sdk.py](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/basic/agents_sdk.py) — Integration with OpenAI Agents SDK
9-
-[pii_mask_example.py](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/basic/pii_mask_example.py) — PII detection and scrubbing
10-
-[structured_outputs_example.py](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/basic/structured_outputs_example.py) — Using responses.parse with guardrails
11-
-[Streaming (fast)](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/implementation_code/fast) — Stream output while guardrails run
12-
-[Blocking (slow)](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/implementation_code/slow) — Validate fully before showing output
7+
-[hello_world.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/hello_world.py) — Basic pipeline configuration with input/output guardrails
8+
-[agents_sdk.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/agents_sdk.py) — Integration with OpenAI Agents SDK
9+
-[pii_mask_example.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/pii_mask_example.py) — PII detection and scrubbing
10+
-[structured_outputs_example.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/structured_outputs_example.py) — Using responses.parse with guardrails
11+
-[Streaming](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/streaming) — Stream output while guardrails run
12+
-[Blocking](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/blocking) — Validate fully before showing output
1313

1414
##Hallucination Detection Example
1515

1616
Complete implementation using real documents as knowledge sources:
17-
[`examples/hallucination_detection/`](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/hallucination_detection)
17+
[`examples/hallucination_detection/`](https://github.com/openai/openai-guardrails-python/tree/main/examples/hallucination_detection)
1818

1919
##Getting Started
2020

2121
1. Follow the Quickstart guide:[Python](./quickstart.md)
22-
2. Explore repositories:[Python examples](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/)
22+
2. Explore repositories:[Python examples](https://github.com/openai/openai-guardrails-python/tree/main/examples/)
2323
3. Run scripts to see Guardrails in action
2424

2525
Each example is self-contained with clear configuration and usage patterns.

‎docs/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Guardrails
22

3-
**Guardrails** is a safety framework for LLM applications that automatically validates inputs and outputs using configurable checks. Use the[Guardrails Wizard](https://guardrails-vercel-git-main-openai.vercel.app/guardrails) to create configurations, then drop in our client classes for automatic validation.
3+
**Guardrails** is a safety framework for LLM applications that automatically validates inputs and outputs using configurable checks. Use the[Guardrails Wizard](https://platform.openai.com/guardrails) to create configurations, then drop in our client classes for automatic validation.
44

55
![Guardrails Wizard](assets/images/guardrails_wizard_screenshot.png)
66

@@ -42,7 +42,7 @@ print(response.llm_response.output_text)
4242

4343
-[Quickstart](./quickstart.md) - Full quickstart guide
4444
-[Examples](./examples.md) - See real implementations
45-
-[Guardrails Wizard](https://guardrails-vercel-git-main-openai.vercel.app/guardrails) - Create configurations visually
45+
-[Guardrails Wizard](https://platform.openai.com/guardrails) - Create configurations visually
4646

4747
##Disclaimers
4848

‎docs/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export OPENAI_API_KEY=sk-...
2121

2222
##Create Pipeline Configuration
2323

24-
The fastest way is using the[Guardrails Wizard](https://guardrails-vercel-git-main-openai.vercel.app/guardrails) - a no-code tool for creating configurations.
24+
The fastest way is using the[Guardrails Wizard](https://platform.openai.com/guardrails) - a no-code tool for creating configurations.
2525

2626
Or define manually:
2727

‎docs/ref/checks/hallucination_detection.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ print(response.llm_response.output_text)
7979

8080
###Complete Example
8181

82-
See[`examples/hallucination_detection/`](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/hallucination_detection) for the full implementation.
82+
See[`examples/hallucination_detection/`](https://github.com/openai/openai-guardrails-python/tree/main/examples/hallucination_detection) for the full implementation.
8383

8484
###Notes
8585

‎docs/streaming_output.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ response = await client.responses.create(
4747

4848
See complete examples:
4949

50-
-[Non-streaming (safe)](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/implementation_code/slow)
51-
-[Streaming (fast)](https://github.com/OpenAI-Early-Access/guardrails/tree/main/guardrails/examples/implementation_code/fast)
50+
-[Non-streaming (blocking)](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/blocking)
51+
-[Streaming](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/streaming)

‎examples/implementation_code/slow/slow_completions.py‎renamed to ‎examples/implementation_code/blocking/blocking_completions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Minimal non-streaming implementation with guardrails using the new GuardrailsClient."""
1+
"""Minimal non-streaming(blocking)implementation with guardrails using the new GuardrailsClient."""
22

33
# Please integrate openai-guardrails into my LLM calls.
44

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp