Skip to content

Restricted mode

MaartenHilferink edited this page Nov 29, 2026 · 1 revision

In restricted mode GeoDMS calculates a configuration without letting it act outside two folders: it runs no command line, and it writes only in the LocalDataDir of the process and in an export folder. The mode is meant for a process that runs configurations it was handed, such as the GeoDMS MCP server, through which an AI agent uses GeoDMS as a tool.

switching it on

Restricted mode is set per process, by the environment variable GEODMS_RestrictedMode of that process: any value other than 0, false, no or off switches it on. It is not a registry setting and not a status flag, so it ends with the process and cannot be switched off from inside it, nor by a configuration.

The environment variable GEODMS_directories_ExportDir of the same process names the export folder. Without it, the LocalData folder is the only folder that the configuration writes in.

set GEODMS_RestrictedMode=1
set GEODMS_directories_ExportDir=C:/LocalData/mymodel_export
GeoDmsRun.exe C:\prj\mymodel\cfg\main.dms /results/export

The LocalData folder is the LocalDataDir of the process, which GEODMS_directories_LocalDataDir can set for that process. A LocalDataProjDir outside it, as a config.ini beside the configuration can name, is not written in; GEODMS_directories_localDataProjDir=%LocalDataDir%/%projName% puts it inside.

what it refuses

  • exec_ec and the other operators that run a command line. The item fails with Restricted mode: exec_ec and the other operators that run a command line are switched off, so '<command line>' was not run.
  • Writing a storage outside the two folders, whatever its StorageType, an MMD store included. The item that would be written fails before it is calculated, with Restricted mode: this item would be written to the storage '<file>'. Every item that uses it fails with it, also an item without a storage of its own: calculating an item writes the storages of the items that it depends on, so asking for a result that only reads such an item still fails.
  • Every other file that the engine writes outside the two folders, such as the files of CopyFile and the folders of makeDir. The item fails with Restricted mode: GeoDMS may not <write the file|make the folder> '<path>'.

Each message ends with the folders that may be written in and the environment variable that set the mode.

Reading is not restricted: a configuration reads its source data wherever it is.

A path is compared after it is made absolute and normalised, so that a path that leaves a folder through .. is outside it; on Windows the comparison ignores case.

what it leaves alone

The files that the command line of GeoDmsRun names are chosen by whoever starts the process, not by the configuration, and are written where it says: the log file of /L, the output file of @file and the dump of @dumpconfig (User Guide GeoDMS Run).

source

rtc/dll/src/utl/RestrictedMode.cpp decides what may be written. The checks are in GetWritePermission and ExecuteChildProcess (rtc/dll/src/utl/Environment.cpp), AbstrStorageManager::OpenForWrite and TreeItem::CommitDataChanges. The testcases are testcases/restricted_*.dms.

Clone this wiki locally