Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@apostrophecms/ai-helper

Latest version: v1.0.0-beta.15

Overview

Last scanned
11 Nov 2026
Published
11 Nov 2026
npm package Publisher: alexgilbert, bodonkey, boutell
4,663 Stars
653 Forks
4 Versions
324 Downloads
JavaScript Repo language

Scan summary

@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.

  • Releases: 4 versions; the latest was published on 11 Nov 2026.
  • Findings: No rules fired in version 1.0.0-beta.15.
  • Downloads: 324 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 1.0.0-beta.15

Findings

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.

Known vulnerabilities

1 CVE · last 20 Oct 2026

0 CRITICAL 0 HIGH 1 MEDIUM 0 LOW

Versions

  • ≥ 1.0.0-beta.13
  • ≥ 1.0.0-beta.10, < 1.0.0-beta.13 1 MEDIUM
  • < 1.0.0-beta.10

Vulnerabilities

  • CVE-2026-113671 Medium 20 Oct 2026 ApostropheCMS: Host header controls server-side image fetch origin in @apostrophecms/ai-helper, enabling authenticated SSRF Fixed in 1.0.0-beta.13

README

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.

⚠️ Beta / Experimental Module

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:

  • Functional but evolving: Core features work well and are production-ready, but the UI/UX may not have the polish of finished ApostropheCMS modules
  • Active development: Features and APIs may change as we refine the AI integration experience
  • Future migration: Much of this functionality will eventually move into ApostropheCMS core as part of a comprehensive AI coordination system

Who should use this module:

  • Developers comfortable with experimental features who want early access to AI capabilities
  • Teams willing to provide feedback to help shape ApostropheCMS AI features
  • Projects that can adapt to potential UI/API changes in future updates

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.

Why AI Helper?

  • ⚡ Accelerate Content Creation: Generate high-quality text and images in seconds, not hours
  • 🎯 Stay in Your Workflow: AI generation built directly into the rich text editor and media manager
  • 🔌 Your Choice of AI Provider: Use OpenAI, Anthropic Claude, or Google Gemini - switch anytime
Table of Contents
  • Installation
  • Configuration
    • Enable AI Text Generation
    • (Optional) Customize System Prompt
    • (Optional) Configure Security Headers
    • Mock Mode for Testing
  • Usage
    • Generating Images
    • Generating Text
  • Provider Configuration Options
    • OpenAI Provider
    • Anthropic Provider
    • Gemini Provider
  • Mix and Match Providers
  • Bundled Providers
  • Provider Metadata
  • Custom AI Providers
    • Provider Architecture
    • Provider Registration
    • Custom Provider Contract
    • Error Handling
    • Metadata
    • Implementation Guidance
  • API Endpoints
    • List Registered Providers
  • 💎 Ready for Enterprise AI Features?
    • 🚀 Pro AI Features
  • Need Help?
  • License

Installation

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.

Configuration

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.js configuration. 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:

  • Environment variables: APOS_OPENAI_KEY, APOS_ANTHROPIC_KEY, APOS_GEMINI_KEY
  • Configuration options: textProviderOptions.apiKey or imageProviderOptions.apiKey

Note: You only need to provide keys for the services you will be using.

Enable AI Text Generation

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' }
              ]
            }
          }
        }
      }
    }
  }
};
(Optional) Customize System Prompt

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:

  1. Per-area prompt
  2. Global prompt
  3. Default guardrails

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 AI
  • appendSystemPrompt - When true, appends your prompt to the default guardrails. When false, replaces them entirely.

Tip: Set appendSystemPrompt: true to keep the default guardrails (Markdown formatting, no meta-commentary) while adding your brand voice or style requirements. Per-area configuration overrides global settings.

(Optional) Configure Security Headers

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.

Mock Mode for Testing

For offline development and testing without API calls or costs:

export APOS_AI_HELPER_MOCK=true

When enabled:

  • Text generation returns pre-defined sample content
  • Image generation returns placeholder images
  • No API keys required
  • No external network calls made
  • Instant responses for rapid iteration

Note: Mock mode metadata may not match actual provider responses exactly.

Usage

Generating Images
  1. Add an image widget to your page
  2. Click "Browse" to open the media manager
  3. Click the 🤖 robot button in the upper right
  4. Enter a description and click "Generate"
  5. Review the generated image(s) (1 is the default)
  6. Click "Select" to import to media library, "Variants" for variations, or "Delete"

Note: Generated images expire after 1 hour if not imported to your media library.

Generating Text

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.

  1. In a rich text widget, press / at the start of a line
  2. Choose "Generate Text"
  3. Enter your prompt (be specific!)
  4. Click "Generate"

Prompt Tips:

  • Specify a word count: "Write 200 words about sustainable packaging"
  • Request specific formats: "Write a bulleted list of 5 benefits of..."
  • Ask for structure: "Write an article with 3 sections about cloud migration"
  • Include tone: "Write a friendly, conversational guide to..."

Provider Configuration Options

Each provider supports specific configuration parameters through textProviderOptions and imageProviderOptions:

OpenAI Provider
'@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
    }
  }
}
Anthropic Provider
'@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.

Gemini Provider
'@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.

Mix and Match Providers

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.

Bundled Providers

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')

  • Text generation (GPT models)
  • Image generation (GPT Image models)
  • Image variations
  • Uses imageSize parameter (e.g., '1024x1024')

Anthropic (textProvider: 'anthropic')

  • Text generation (Claude models)
  • No image generation support

Gemini (textProvider: 'gemini' / imageProvider: 'gemini')

  • Text generation (Gemini models)
  • Image generation (Gemini Image models)
  • Image variations
  • Uses imageAspectRatio parameter (e.g., '1:1', '16:9', '9:16')

Provider Metadata

All providers return metadata with each generation, including:

  • Model used
  • Token counts and usage statistics
  • Provider-specific details (stop reasons, timestamps, etc.)

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.

Custom AI Providers

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).

Provider Architecture

The AI Helper uses a two-phase provider system:

  1. Registration - Providers register their factory function and metadata (capabilities, label)
  2. Activation - The core module instantiates only the providers actually configured for use

This means you can register multiple providers without the overhead of instantiating unused services.

Provider Registration

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:

  • As a dedicated ApostropheCMS module, or
  • As a factory function registered during another module's initialization

Both patterns must register a factory function - the AI Helper core handles instantiation.


Custom Provider Contract

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.


Provider Registration API

Providers register using registerProvider(name, factoryInfo):

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm @apostrophecms/ai-helper

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229