{
    "mode": "man",
    "parameter": "aa-exec",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/aa-exec/1/json",
    "generated": "2026-06-03T03:32:58Z",
    "synopsis": "aa-exec [options] [--] [<command> ...]",
    "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": []
        }
    },
    "summary": "aa-exec - confine a program with the specified AppArmor profile",
    "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"
        },
        {
            "name": "AA-EXEC",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/AA-EXEC/1/json"
        }
    ]
}