Scan your whole stack
From OX Research Newsroom
Are you using @apostrophecms/ai-helper?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.0-beta.15
@apostrophecms/ai-helper was last scanned on 11 Nov 2026 at version 1.0.0-beta.15. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.0-beta.15 LATEST | 11 Nov 2026 | No rules fired |
| 1.0.0-beta.14 | 14 Oct 2026 | No rules fired |
| 1.0.0-beta.13 | 30 Sep 2026 | No rules fired |
| 1.0.0-beta.12 | 13 Aug 2026 | Not shown |
Findings for v1.0.0-beta.15. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.0.0-beta.15; other versions have their own rules, not their own score.
0 CRITICAL 0 HIGH 1 MEDIUM 0 LOW
The publisher’s own README, as collected from the registry.
Bring AI-powered content generation directly into your ApostropheCMS editing workflow. Generate compelling text and stunning images from simple prompts, all without leaving the CMS. Choose your preferred AI provider (OpenAI, Anthropic Claude, or Google Gemini) or connect to enterprise AI services.
This module is experimental and will remain in beta status. It provides early access to AI-powered content generation features in ApostropheCMS, but you should expect:
Who should use this module:
Stability note: While the module is marked as beta, it is used in production environments. The "experimental" designation reflects ongoing UI refinement rather than fundamental instability.
To install the module, use the command line to run this command in an Apostrophe project's root directory:
npm install @apostrophecms/ai-helper
All providers (OpenAI, Anthropic, Gemini) are bundled with the main package - no separate installation needed.
Configure the AI helper module in your app.js file:
import apostrophe from 'apostrophe';
apostrophe({
root: import.meta,
shortName: 'my-project',
modules: {
'@apostrophecms/ai-helper': {
options: {
// Choose which providers to use
textProvider: 'openai', // 'openai', 'anthropic', or 'gemini'
imageProvider: 'openai', // 'openai' or 'gemini'
// Configure your text provider
textProviderOptions: {
apiKey: process.env.APOS_OPENAI_KEY, // or export APOS_OPENAI_KEY
textModel: 'gpt-5.1',
textMaxTokens: 1000
},
// Configure your image provider
imageProviderOptions: {
apiKey: process.env.APOS_OPENAI_KEY, // or export APOS_OPENAI_KEY
imageModel: 'gpt-image-1-mini',
imageSize: '1024x1024',
imageQuality: 'medium',
imageCount: 1
}
}
}
}
});
Note: Providers are selected at application startup via
app.jsconfiguration. Switching providers at runtime via an admin UI is not currently supported.
API Keys: Each provider requires its own API key. You can set them via:
APOS_OPENAI_KEY, APOS_ANTHROPIC_KEY, APOS_GEMINI_KEYtextProviderOptions.apiKey or imageProviderOptions.apiKeyNote: You only need to provide keys for the services you will be using.
Add the AI option to your rich text widget toolbar in any area configuration:
// modules/article/index.js
export default {
extend: '@apostrophecms/piece-type',
fields: {
add: {
main: {
type: 'area',
options: {
widgets: {
'@apostrophecms/rich-text': {
toolbar: [ 'styles', 'bold', 'italic', 'bulletList', 'orderedList' ],
insert: [ 'ai' ], // Enable AI text generation
styles: [
{ name: 'Heading', tag: 'h2' },
{ name: 'Subheading', tag: 'h3' },
{ name: 'Paragraph', tag: 'p' }
]
}
}
}
}
}
}
};
Default System Prompt (with guardrails):
You are a helpful text-generation assistant for CMS content. You generate text in Markdown format based on the given prompt. Do not include any meta-commentary, explanations, or offers to create additional versions. Output the content directly without preamble or postamble.
Customize how the AI generates text by modifying the system prompt. This can be configured globally (affects all rich text widgets) or per-area (specific areas only). Note that any prompt passed to a widget in an area will override the prompt set globally.
Precedence order:
Global Configuration (in app.js):
import apostrophe from 'apostrophe';
apostrophe({
root: import.meta,
modules: {
'@apostrophecms/rich-text-widget': {
options: {
customSystemPrompt: 'Write in a professional, technical tone suitable for enterprise documentation.',
appendSystemPrompt: true // Append to default guardrails instead of replacing
}
}
}
});
Per-Area Configuration:
// modules/article/index.js
export default {
extend: '@apostrophecms/piece-type',
fields: {
add: {
main: {
type: 'area',
options: {
widgets: {
'@apostrophecms/rich-text': {
toolbar: [ 'styles', 'bold', 'italic', 'bulletList', 'orderedList' ],
insert: [ 'ai' ],
// Customize AI behavior for this specific area
customSystemPrompt: 'Write in a casual, conversational tone for blog content.',
appendSystemPrompt: true
}
}
}
}
}
}
};
Options:
customSystemPrompt - Your custom instructions for the AIappendSystemPrompt - When true, appends your prompt to the default guardrails. When false, replaces them entirely.Tip: Set
appendSystemPrompt: trueto keep the default guardrails (Markdown formatting, no meta-commentary) while adding your brand voice or style requirements. Per-area configuration overrides global settings.
If using the @apostrophecms/security-headers module, add AI image sources:
// modules/@apostrophecms/security-headers/index.js
export default {
options: {
policies: {
ai: {
'img-src': '*.blob.core.windows.net' // OpenAI image URLs
}
}
}
};
Note: This is an example only. The exact img-src value depends on the AI provider and region you are using.
For offline development and testing without API calls or costs:
export APOS_AI_HELPER_MOCK=true
When enabled:
Note: Mock mode metadata may not match actual provider responses exactly.
Note: Generated images expire after 1 hour if not imported to your media library.
Note: Generated content may include headings, bullet lists, bold, italic, and other formatting. Make sure your rich text widget toolbar includes the formatting options you want to preserve (e.g.,
toolbar: [ 'styles', 'bold', 'italic', 'bulletList', 'orderedList' ]). Unsupported formatting will be stripped when inserted.
/ at the start of a linePrompt Tips:
Each provider supports specific configuration parameters through textProviderOptions and imageProviderOptions:
'@apostrophecms/ai-helper': {
options: {
textProvider: 'openai',
imageProvider: 'openai',
textProviderOptions: {
apiKey: process.env.APOS_OPENAI_KEY,
textModel: 'gpt-5.1', // Text model to use
textMaxTokens: 1000, // Max tokens for text generation
textRetries: 3 // Times to reattempt generation on timeout
},
imageProviderOptions: {
apiKey: process.env.APOS_OPENAI_KEY,
imageModel: 'gpt-image-1-mini', // Image model to use
imageSize: '1024x1024', // Image dimensions
imageQuality: 'medium', // 'low', 'medium', or 'high'
imageCount: 1 // Number of images to generate
}
}
}
'@apostrophecms/ai-helper': {
options: {
textProvider: 'anthropic',
textProviderOptions: {
apiKey: process.env.APOS_ANTHROPIC_KEY,
textModel: 'claude-sonnet-4-20250514', // Claude model to use
textMaxTokens: 1000, // Max tokens for text generation
textRetries: 3 // Times to reattempt generation on timeout
}
}
}
Note: Anthropic does not support image generation. Use OpenAI or Gemini for images.
'@apostrophecms/ai-helper': {
options: {
textProvider: 'gemini',
imageProvider: 'gemini',
textProviderOptions: {
apiKey: process.env.APOS_GEMINI_KEY,
textModel: 'gemini-2.5-flash-lite', // Text model to use
textMaxTokens: 1000, // Max tokens for text generation
textRetries: 3 // Times to reattempt generation on timeout
},
imageProviderOptions: {
apiKey: process.env.APOS_GEMINI_KEY,
imageModel: 'gemini-2.5-flash-image', // Image model to use
imageAspectRatio: '1:1', // '1:1', '16:9', or '9:16'
imageCount: 1 // Number of images to generate
}
}
}
Note: Gemini uses imageAspectRatio instead of imageSize.
The values shown are default values used for all generations. Future versions may support per-request options through the UI.
Use different providers for text and images to optimize for cost, quality, or capability:
import apostrophe from 'apostrophe';
apostrophe({
root: import.meta,
modules: {
'@apostrophecms/ai-helper': {
options: {
textProvider: 'anthropic', // Use Claude for text generation
imageProvider: 'gemini', // Use Gemini for image generation
textProviderOptions: {
apiKey: process.env.APOS_ANTHROPIC_KEY,
textModel: 'claude-sonnet-4-20250514'
},
imageProviderOptions: {
apiKey: process.env.APOS_GEMINI_KEY,
imageModel: 'gemini-2.5-flash-image',
imageAspectRatio: '16:9'
}
}
}
}
});
Note: Provider switching is currently configured in app.js. A future admin UI may allow switching providers without code changes.
All providers are included with @apostrophecms/ai-helper - no separate installation needed. They are implemented as lightweight factory functions and configured through textProviderOptions and imageProviderOptions.
OpenAI (textProvider: 'openai' / imageProvider: 'openai')
imageSize parameter (e.g., '1024x1024')Anthropic (textProvider: 'anthropic')
Gemini (textProvider: 'gemini' / imageProvider: 'gemini')
imageAspectRatio parameter (e.g., '1:1', '16:9', '9:16')All providers return metadata with each generation, including:
For text generation, metadata is returned alongside the generated content in the API response. This allows you to capture usage information if needed for custom auditing or analytics at the project level.
For image generation, metadata is stored temporarily in the aposAiHelperImages collection as providerMetadata on each generated image. This data persists for 1 hour (until cleanup) or until the image is imported to your media library.
The module does not automatically log or persist this metadata beyond what's needed for operation. If you need detailed auditing, cost tracking, or analytics, you can extend the relevant modules to capture and process this data according to your requirements.
In addition to the bundled OpenAI, Anthropic, and Gemini providers, @apostrophecms/ai-helper supports custom AI providers for organizations that need to integrate enterprise platforms or internal AI services
(e.g. AWS Bedrock, Azure OpenAI, self-hosted models).
The AI Helper uses a two-phase provider system:
This means you can register multiple providers without the overhead of instantiating unused services.
Custom providers register a factory function along with metadata. The factory function will be called by the core module during activation if the provider is configured for use.
Providers can be implemented either:
Both patterns must register a factory function - the AI Helper core handles instantiation.
Custom providers must implement a well-defined contract so the AI Helper can normalize behavior across different AI services.
Streaming responses are not currently supported. Providers must return complete results for text and image generation. Partial or incremental responses will be ignored.
Providers register using registerProvider(name, factoryInfo):
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.