{
    "content": [
        {
            "type": "text",
            "text": "# AA-EXEC (man)\n\n## NAME\n\naa-exec - confine a program with the specified AppArmor profile\n\n## SYNOPSIS\n\naa-exec [options] [--] [<command> ...]\n\n## DESCRIPTION\n\naa-exec is used to launch a program confined by the specified profile and or namespace.  If\nboth a profile and namespace are specified command will be confined by profile in the new\npolicy namespace.  If only a namespace is specified, the profile name of the current\nconfinement will be used.  If neither a profile or namespace is specified command will be run\nusing standard profile attachment (ie. as if run without the aa-exec command).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **BUGS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "AA-EXEC",
        "section": "",
        "mode": "man",
        "summary": "aa-exec - confine a program with the specified AppArmor profile",
        "synopsis": "aa-exec [options] [--] [<command> ...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-i",
                "long": "--immediate",
                "arg": null,
                "description": "transition to PROFILE before doing executing <command>. This subjects the running of <command> to the exec transition rules of the current profile."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "show commands being performed"
            },
            {
                "flag": "-d",
                "long": "--debug",
                "arg": null,
                "description": "show commands and error codes -- Signal the end of options and disables further option processing. Any arguments after the -- are treated as arguments of the command. This is useful when passing arguments to the <command> being invoked by aa-exec."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "aa-stack",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/aa-stack/8/json"
            },
            {
                "name": "aa-namespace",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/aa-namespace/8/json"
            },
            {
                "name": "apparmor",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/apparmor/7/json"
            },
            {
                "name": "apparmor.d",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/apparmor.d/5/json"
            },
            {
                "name": "aachangeprofile",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/aachangeprofile/3/json"
            },
            {
                "name": "aachangeonexec",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/aachangeonexec/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": [
                    {
                        "name": "OPTIONS aa-exec accepts the following arguments:",
                        "lines": 8
                    },
                    {
                        "name": "-i, --immediate",
                        "lines": 3,
                        "flag": "-i",
                        "long": "--immediate"
                    },
                    {
                        "name": "-v, --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-d, --debug",
                        "lines": 6,
                        "flag": "-d",
                        "long": "--debug"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "aa-exec - confine a program with the specified AppArmor profile\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "aa-exec [options] [--] [<command> ...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "aa-exec is used to launch a program confined by the specified profile and or namespace.  If\nboth a profile and namespace are specified command will be confined by profile in the new\npolicy namespace.  If only a namespace is specified, the profile name of the current\nconfinement will be used.  If neither a profile or namespace is specified command will be run\nusing standard profile attachment (ie. as if run without the aa-exec command).\n\nIf the arguments are to be pasted to the <command> being invoked by aa-exec then -- should be\nused to separate aa-exec arguments from the command.\naa-exec -p profile1 -- ls -l\n",
                "subsections": [
                    {
                        "name": "OPTIONS aa-exec accepts the following arguments:",
                        "content": "-p PROFILE, --profile=PROFILE\nconfine <command> with PROFILE. If the PROFILE is not specified use the current profile\nname (likely unconfined).\n\n-n NAMESPACE, --namespace=NAMESPACE\nuse profiles in NAMESPACE.  This will result in confinement transitioning to using the\nnew profile namespace.\n"
                    },
                    {
                        "name": "-i, --immediate",
                        "content": "transition to PROFILE before doing executing <command>.  This subjects the running of\n<command> to the exec transition rules of the current profile.\n",
                        "flag": "-i",
                        "long": "--immediate"
                    },
                    {
                        "name": "-v, --verbose",
                        "content": "show commands being performed\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-d, --debug",
                        "content": "show commands and error codes\n\n--  Signal the end of options and disables further option processing. Any arguments after the\n-- are treated as arguments of the command.  This is useful when passing arguments to the\n<command> being invoked by aa-exec.\n",
                        "flag": "-d",
                        "long": "--debug"
                    }
                ]
            },
            "BUGS": {
                "content": "If you find any bugs, please report them at <https://gitlab.com/apparmor/apparmor/-/issues>\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "aa-stack(8), aa-namespace(8), apparmor(7), apparmor.d(5), aachangeprofile(3),\naachangeonexec(3) and <https://wiki.apparmor.net>.\n\n\n\nAppArmor 3.0.4                               2025-08-15                                   AA-EXEC(1)",
                "subsections": []
            }
        }
    }
}